InfoPath Drop-down control

W

Walter

I want to concatenate multiple columns from a SharePoint list into a
drop-down control on my InfoPath form... This works fine for two strings, but
I can't seem to figure out how to concatenate a date value.. My failed
attempts include:

concat(Month(@StartDate) , '/' , Day(@StartDate) , '/' , Year(@StartDate),
'-', @Location, '-', @Title)
concat(month-from-dateTime(@StartDate) , '/' , day-from-dateTime(@StartDate)
, '/' , year-from-dateTime(@StartDate), '-', @Location, '-', @Title)
concat(@StartDate, '-', @Location, '-', @Title)
concat(month-from-date(@StartDate), '-', @Location, '-', @Title)
concat(fn:month-from-date(@StartDate), '-', @Location, '-', @Title)
concat(months(@StartDate), '-', @Location, '-', @Title)
concat(format-date(@StartDate,'mm/dd/yyyy'), '-', @Location, '-', @Title)

Any suggestion is welcomed...
 
B

Ben Walters

Hey Walter
First issue your going to have with your file name is the existance of
forward slashes these are not valid for a file name. As for the date it's
self it seems your need to convert it before you save the file, why don't you
convert the date in the Infopath form on load e.g.
<Root>
<SPList Date=""/>
<FileName Date""/>
</Root>

if you have the date comming from the sharepoint list in the date attribute
on the SPList field simply convert it to text or the dateformat you want in
code and copy i t into the date attribute on teh FileName field. Then when
you attempt to save youc an use concat(FileName\@Date,'-',@Location)

Hope this helps

Cheers
Ben
 
B

Ben Walters

Sorry Walter forgive the context of my last post I though you were attempting
to use the concatenated field to save the file, upon rereading your post I
notice I mis-interpreted the question.

looking at your code the concatenation command your using seems correct
although I dont' think breaking down a date value into it's separate
components is possible in an XPath expression, Best bet is to build up the
concat piece by piece

concat(@StartDate,'-')
concat(@StartDate,'-', @Location)
concat(@StartDate,'-', @Location,'-')
concat(@StartDate,'-', @Location,'-',@Title)

Then see how you go

Hope this helps, once again sorry for the incorrect response
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top