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.
Solved! Go to Solution.
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
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.
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.