Skip to main content
Nintex Community Menu Bar
Solved

How do I schedule a site workflow to use the current date for start data

  • Oct 19, 2021 3:33 AM UTC
  • 3 replies
  • 97 views
  • Translate All

Forum|alt.badge.img+4

I have a site workflow that has a single start data value of a date/time variable called dtTodaysDate. In the workflow I have the variable set to default to "Today's Date", show on Start Form, required and display as Date Only. Note that I have built a start form in case a user needs to run the workflow adhoc passing in a specific date.

When I schedule the workflow I want it to run daily indefinitely and to use the current days date. When scheduling, it prompts me to select a start date for dtTodaysDate, I left it as the current date and saved.

The first scheduled run was correct using the date shown in the start variable. Subsequent days however always use that same first day as when I scheduled it.

I know it is possible to do as we have another scheduled site workflow doing this but I can't seem to figure out how it was done.

Best answer by ethurber

Hi.

 

How about this. 

Make the date an optional field.  If they enter a value, use that one.  If it's left blank, then use Start Date.

View original

3 replies

Forum|alt.badge.img+6
  • Rookie
  • Oct 19, 2021 4:34 PM UTC

Hi.

If the value will always be the date the workflow was executed, I recommend setting the dtTodaysDate variable to the Start Date context variable from within the workflow. 

 

This eliminates the need to prompt for it during initiation.

 

Hope this helps

Translate

Forum|alt.badge.img+4
  • Author
  • Rookie
  • Oct 19, 2021 9:45 PM UTC

That would totally work when running the workflow from the schedule. The problem is, if for whatever reason they wish to manually start the workflow and pass in a historical date using the start form it would always use the current date when the workflow starts, overwriting the value they selected for dtTodaysDate on the start form.

Translate

Forum|alt.badge.img+6
  • Rookie
  • Answer
  • Oct 20, 2021 2:06 PM UTC

Hi.

 

How about this. 

Make the date an optional field.  If they enter a value, use that one.  If it's left blank, then use Start Date.

Translate