cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Collection Date Variable

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?

Labels: (2)
Tags (1)
Reply
4 Replies
Workflow Hero

Re: Collection Date Variable

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

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Collection Date Variable

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

0 Kudos
Accept as Solution Reply
Not applicable

Re: Collection Date Variable

you are getting this error because "ColFirstDayOfLeave" have some null values too along with the "First DAy Of Leave" dates and when you assign those null values in "First Day Of Leave" variable which is a DateTime variable I assume, will start creating problem, so make it sure that ColFirstDayOfLeave doesn't get any null values in it.   thanks Muhammad Mavia

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Collection Date Variable

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

0 Kudos
Accept as Solution Reply