cancel
Showing results for 
Search instead for 
Did you mean: 
cvuppala
Nintex Newbie

Date Collection variable

Jump to solution

Hi,

Here is my scenaio:

I am querying list and collecting "Date initiated" column values into a collection variable. I now would like to iterate through each date initiated value and calculate "Number of days in Approval" which is a difference between (current date and Date initiated). I then update the number of days in approval field in the list item.

Sounds simple but with dates involved in the collection, I am not able to achieve this.

  • I iterate through Date initiated collection and store each date in "var_datestring" String variable. 
  • I then use convert value to use "datediffdays" function to calculate the difference between var_datestring and current date.

I schedule this workflow once a day and the workflow ends with the error below

Collection Operation Configuration:

Convert value action configuration.

Error received:

Reply
5 Replies
Automation Master
Automation Master

Re: Date Collection variable

Jump to solution

I think you should use convert value first time round to convert your string variable into a date variable.

Then use date difference to calculate difference between the Current Date and the date variable in the above step.

Reply
cvuppala
Nintex Newbie

Re: Date Collection variable

Jump to solution

Hi Cassy,

Can you please outline the steps ? I am not sure how "time round" string variable? I tried to use date value as is but then Collection operation does not work with date values.

Thank you,

Reply
Automation Master
Automation Master

Re: Date Collection variable

Jump to solution

No I mean:

step 1: use convert value action to convert your collection item from string into date format

steo 2: use date difference with value from step 1 and current date

Reply
cvuppala
Nintex Newbie

Re: Date Collection variable

Jump to solution

Hi Cassy,

It wasn't working. Can you please give clear steps that worked for you.

Reply
Automation Master
Automation Master

Re: Date Collection variable

Jump to solution

I have a collection of date fields vCollDateInitiated.

In my for each, I pull a text value vTextDateInitiated (the same as your var_datestring)

I then use (inside the for each) the convert value action as follows:

this converts my text date into a date variable called vDateDateIntiated

Then I use date diff like this:

fn-DateDiffDays({Common:CurrentDate},{WorkflowVariable:vDateDateInitiated})

View solution in original post

Reply