Pass a value to a SharePoint Designer 2013 site workflow
Learn how you can use workflow parameters to pass values to a SharePoint Designer 2013 site workflow.
If you want to pass a value to a site workflow, you must make use of workflow initiation parameters.
Workflow initiation parameters are similar to workflow variables in that they both serve as storage locations for values in a workflow.
The main difference between the two is that workflow parameters can be set from outside of a workflow, while workflow variables are generally used within a workflow. So basically, workflow parameters can be seen as public variables, while workflow variables can be seen as private variables.
Here, you will use SharePoint Designer 2013 to create a site workflow that accepts a string value, and then writes that value to the workflow history list.
Before you begin, ensure you have gone through the tutorial to create a simple workflow in SharePoint Designer 2013, so that you know how to add actions to and publish a workflow.
To create a site workflow that accepts a value in SharePoint Designer 2013
- Follow the steps outlined in Create and start a SharePoint Designer 2013 site workflow to create a simple site workflow that has a Log to History List workflow action. Note: Do not configure the workflow action; just add it to the workflow.
- Click Workflows > Variables > Initiation Form Parameters.
- On the Association and Initiation Form Parameters dialog box, click Add.
- On the Add Field dialog box, type MyOutOfWFValue in the Field name text box, leave Single line of text selected in the Information type drop-down list box, and click Next.
- On the Column Settings dialog box, click Finish.
- On the Association and Initiation Form Parameters dialog box, click OK.
- Click message in the sentence for the workflow action, and then click the formula button (second button) behind the text box that appears.
- On the Lookup for String dialog box, select Workflow Variables and Parameters from the Data source drop-down list box, select Parameter: MyOutOfWFValue from the Field from source drop-down list box, and click OK. The final sentence for the workflow action should say:
Log Parameter: MyOutOfWFValue to the workflow history list
- Publish the workflow to SharePoint.
To pass a value to a site workflow in SharePoint 2013
- Follow the steps outlined in Create and start a SharePoint Designer 2013 site workflow to start the workflow.
- On the workflow start page, type a value in the text box, and then click Start.
- Wait for the workflow to run and complete, and then go to the workflow history list and verify that the value you entered at startup was written to the history list.
Still unclear? Watch the SharePoint 2013 video tutorial below.
- Basic tasks for creating SharePoint Designer workflows
- Create and start a SharePoint Designer 2013 site workflow
- Create a simple SharePoint Designer 2013 workflow
- Create a SharePoint Designer 2013 reusable workflow
- SharePoint Designer 2013 workflow to start another workflow