4 Ways to set a date value in a SharePoint Designer workflow
© 2008-2011 DocumentManagementWorkflowInfo.com - Read our Copyright Notice
Learn how you can set the value of a date variable or field in a SharePoint Designer workflow to be either a static, dynamic, or calculated date.
The values of dates in SharePoint Designer workflows can be static or dynamic, that is, you can set them to be a specific date (static), or you can calculate them or set them to the value of other date fields (dynamic).
You have 4 options when it comes to setting the value of a date field in a SharePoint Designer workflow. You can use:
- The current date (today).
- A specific date.
- The value of a date field in a list.
- The value of a workflow variable that is a date or the result of a date calculation.
This article uses a Set Workflow Variable action to demonstrate how to set the value of a date field in SharePoint Designer.
Setting up the sample
- Create a SharePoint Designer workflow in which you want to set or calculate a date.
- On the Step 1 screen of the Workflow Designer, click Actions, and select More Actions from the drop-down menu.
- On the Workflow Actions dialog box, select Core Actions from the category drop-down list box, select Set Workflow Variable from the actions list, and click Add.
- On the Step 1 screen of the Workflow Designer, click workflow variable in the text for the action, and select create a new variable from the drop-down list box that appears.
- On the Edit Variable dialog box, type a name for the variable (for example MyDateTime), select Date/Time from the type drop-down list box, and click OK.
1. Set a workflow variable to the current date (today)
To set a workflow variable to the current date:
- Click value in the text for the action you created in Setting up the sample.
- Click the ellipsis button behind the text box.
- On the Date Value dialog box, select Current date, and click OK.

Figure 1. Setting the value of a workflow variable to the current date (today) in SharePoint Designer.
2. Set a workflow variable to a specific date
To set a workflow variable to a specific date:
- Click value in the text for the action you created in Setting up the sample.
- Click the ellipsis button behind the text box.
- On the Date Value dialog box, select Specific date, select a date and/or time, and click OK.

Figure 2. Setting the value of a workflow variable to a specific date in SharePoint Designer.
3. Set a workflow variable to the value of a date field in a list
To set a workflow variable to a date value in a list:
- Click value in the text for the action you created in Setting up the sample.
- Click the formula button behind the text box.
- On the Define Workflow Lookup dialog box, define a lookup to the date field you want to set the workflow variable to, and click OK.

Figure 3. Setting the value of a workflow variable to the value of a date field in a list in SharePoint Designer.
4. Set a workflow variable to the value of a date calculation
To set a workflow variable to the value of a date calculation, for example, to a date that is 3 days from today:
- On the Step 1 screen of the Workflow Designer, click Actions, and select More Actions from the drop-down menu.
- On the Workflow Actions dialog box, select Core Actions from the category drop-down list box, select Add Time to Date from the actions list, and click Add.
- On the Step 1 screen of the Workflow Designer, click 0 in the text for the action and type 3, click minutes and select days from the drop-down list box, click date, click the ellipsis button.
- On the Date Value dialog box, select the current date, and click OK.
- On the Step 1 screen of the Workflow Designer, hover over the Add Time to Date action until a drop-down appears, click the arrow, and select Move Action Up.
- On the Step 1 screen of the Workflow Designer, click value in the text for the Set Workflow Variable action, and click the formula button behind the text box.
- On the Define Workflow Lookup dialog box, select Workflow Data from the source drop-down list box, select the workflow variable that corresponds to the Add Time to Date action you created earlier, and click OK.

Figure 4. Setting the value of a workflow variable to a date calculation in SharePoint Designer.
Once you’ve set the date of the workflow variable, you can go on to use it in other actions in your SharePoint Designer workflow, such as for example to create a new list item.
Related Articles
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of the owner of DocumentManagementWorkflowInfo.com. The techniques demonstrated in this article may be used within any SharePoint project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the owner of DocumentManagementWorkflowInfo.com.
