Integrating SharePoint data into workflows
Data from SharePoint in either SharePoint columns or form data can be used in many different contexts in your workflows.
On this page
For example, you can use SharePoint column values as follows:
- To drive transitions in your workflows
- Use them in email message contents
- Use them as arguments to plug-ins
In general, referring to the value of a SharePoint column is done by surrounding the SharePoint column name with square brackets. For example, if you have a column named "Invoice Number," you could compose an email message with that data in the email as follows: Your invoice with number [Invoice Number] has been approved.
In a Form, if you have a form field that you want to use in your workflow, promote the field to be a SharePoint column and then refer to it as previously described.
In addition to referring to SharePoint column values, there are also several pseudo fields (see below) that represent values in the current environment.
Pseudo fields table
[$Assignment.Id] | The internal identifier of the current assignment, where applicable. |
[$CurrentUser.LoginName] | The complete domain-qualified login name for the current user. |
[$CurrentUser.Email] | The email address of the current user. |
[$CurrentUser.Name] | The full name of the current user. |
[$CurrentUser.UserName] | The user name portion of the login name. |
[$CurrentUser.UserDomain] | The domain name portion of the login name. |
[$Process.Id] | The internal identifier of the current process, where applicable. |
[$Site.Url] | The fully qualified URL of the current site. |
[$Site.ServerRelativeUrl] | The path portion of the current site's URL. |
[$Site.Authority] | The non-path portion of the current site's URL. |
[$Activity.Name] | The name of the current node of the workflow. |
[$Activity.Description] | The description of the current node of the workflow. |
[$Activity.Actor] | The currently assigned user to the node. |
[$Activity.DueDate] | The due date of the current node. |
[$Activity.AssignedDate] | The date the node was assigned to the user. |
[$Activity.CompletedDate] | The date the user completed the node. |
[$Process.Name] | The name of the current process. |
[$ProcessDefinition.Name] | The name of the current process definition |
NOTE: You can also use Windows environment variables. For example, the syntax for a variable named MY_ENV_VAR is [%MY_ENV_VAR%]. You can also use values from the sharevis.config file in your plug-ins. The syntax for a sharevis.config file value is [$Key$], such as [$TempDirectory$].
Example: Adding a Form Field to the Key Value
Note that you need to be a Worfklow administrator for this example.
- Promote the Field in SharePoint
- Take note of the name of the field you promoted. For example, if you promoted field1 from InfoPath, it probably comes into SharePoint as "Field 1"
- On the Workflow Administration site, open Configure Options (Workflow 10.8 and later). If you are using Workflow 10.5-10.7, use the ShareVis Configurator tool, and then browse to the List you want to change.
- Add the promoted field into the key with the following syntax: [Field 1]