Collection Date Variable


Badge +1

Hi,

 

So I'm developing our first Nintex Form and Workflow to allow staff to apply for Annual leave.  On my form I've a repeating section to allow multiple types of leave  ie 2 days of Annual Leave with 2 day of Sick leave on one form.  The Date field on my form is format as Date only.

Date Field.PNG

 

in my workflow I'm getting the xml from the repeating section and putting field into a collection.  Then I loop through the collection and trying to put the data into a Date & Time variable but the workflow keeps coming back with the following error "Data type returned from the collection is incompatible with the variable to store the result in."  

 

It works fine if I store the data into a Single Line of Text Variable but i need to keep the date as Date and Time.  Is this possible?


3 replies

Userlevel 6
Badge +16

Could you send a sample value when you set it to a Single Line of Text Variable?

Badge +1

Hi Fernando,

It's possible that i doing this completely wrong as this is our first workflow but I need to change the date so that is display dd/MM/yyyy in a email that gets sent.  When I use the Log to History to output the date it's coming back as 06/08/2015 00:00:00

So in my workflow I got the standard Query XML to parse the repeating section into some collections variable, and then I do a For Each, looping through each collection and outputting to a text variable ( I tried a data time one but it didn't like it)

Collection.PNG

How I have setup the Collection operation.  First Day of Leave is a string value.  I tried Date Time variable but workflow would stop with an error Data type returned from the collection is incompatible with the variable to store the result in

Collection Config.PNG

Then I use a Regular Expression to just get the date, Regular Expression Config.PNG

Then I use a Convert Value so that it can convert the string back into a Date so that I can use the Format-Date Function to format the date as dd/MM/YYYYConvert Value Configure.PNG

Badge +16

Did you resolve this with the response above?  Are you able to mark it correct or did you find an alternative solution?

Reply