In this tutorial, you will learn how to use the Initiated By variable to identify the user who ran the workflow or who caused the workflow to run. You will also learn how to get a notification so that you can retrieve information about the user.
Scenarios
You have created a workflow and want to know when another user runs the workflow.
The Initiated By variable is used to retrieve information in the following scenarios:
- A user manually triggers a scheduled workflow by selecting Run Scheduled Workflow in the workflow view.
- A user causes a workflow to run by adding, editing, or archiving a record where the actions in the Begin block are triggered when records are added, edited, or archived.
Note
If the workflow has a manually created variable with the same name, don't worry. The system will automatically append the word Variable to the manual variable name. Manually created variables always adhere to the format {{WFVariables.Variable_name}}
.
The Initiated By variable can be used in all workflow blocks where variables are used, such as the API, Conditional Threshold (Basic mode), Decision, Notify, Relational Update, Scheduled Report, and Update blocks. However, unlike other workflow variables, you cannot add the Initiated By variable to the Response tab of the API block because it might be overwritten by the API response.
Using the Initiated By variable in a Notify block
In the following tutorial, the Initiated By variable is used in a Notify block to:
- Alert a user that a workflow was run.
- Provide the user with information about the user who ran the workflow or who caused the workflow to run.
Complete the following steps:
- Edit a workflow and drag the Notify block onto the canvas
- Click Edit.
-
In the Information tab:
- Select the notification method. You can select Workstream, Email, or both.
- To automatically include a link to the object that triggered the workflow when the workflow is run, select Include Link.
- In the Recipients tab, add the recipients of the email notification. For example, if you want to be notified when the workflow is run, select your name from the list of Oomnitza users in the Users list.
-
In the Message tab, click Select a field in the Subject or Message sections and select the Initiated By variable. The variable name can be appended with a field name, such as
{{WFVarRuntime.initiated_by.first_name}}
or{{WFVarRuntime.initiated_by.email}}
. As custom field names can differ from system to system, it is recommended you check that you are using the correct field name by:- Navigate to Configuration > Data Model > Field Configuration and select the field from the list. The correct field name is located in the External ID.
- Click the Select a field button and select a field from the list. The correct field name is displayed in curly braces.
- Click Save and connect the blocks
- Validate the workflow and Activate it so that the workflow is now live in your system.
Note
To configure the email header and footer, click Configuration > General > Global Settings. Change the key values for the email.header
and email.footer
. Learn more
Fig: Using the Initiated By variable in a Stockroom Actions workflow to identify the user who ran the workflow
Related Links
Tutorial: Applying a workflow variable to an API block
Tutorial: Applying a workflow variable to an update block
Creating a stockroom actions workflow. For detailed steps on how to create a stockroom actions workflow.
Comments
0 comments
Please sign in to leave a comment.