Setting up Workflow Action to Update Field.
Scenario: Calculate the period of Support, the difference in days between the Support start date and end date, the result value to update in the mentioned field.
- Go to Main Menu > CRM Settings > Automation > Workflow.
- Click on "New workflow".
-
Create a Workflow
- The New Workflow edit form will appear, provide the required details.
- "Workflow Name", provide the name of the Workflow.
- "Description", provide the description of the Workflow.
- Select the preferred Module from the "Target Module" drop-down. For example, we would be using the Tickets module.
- "Status", specify the status of the Workflow Active or Inactive. the Workflow will be executed when the status is set to active.
-
Workflow Trigger
- Select the Ticket updated (includes Creations) option under the Trigger Workflow block.
- Select Only first-time conditions are met under the Recurrence section.
- Under the ‘Workflow Condition’ tab, Click on the Add Condition and provides the required conditions to execute the task.
- Under the ‘Workflow Actions’ Click on the Add Action drop-down tab and Click on Update Fields.
-
The Update Fields window will pop up, provide the required details.
- "Action Title" Provide the name of the action, this is just for internal reference.
- Click the "Add Field" button, this opens a small window.
- Choose the Destination field from the drop-down. For example, we would be using the Support Period field as a destination field.
- Click inside the space provided on the right side.
-
Set Value Window will Popup with the following three options is displayed.
- Select Expression from the drop-down, this allows you to enter the expression to calculate the Support Period.
- Click on the Use Function drop-down and select "time_diffdays(a,b)"
- Click on the Use Field drop-down and select Start Date and End Date, you will be getting a field token, Copy the token and paste it into accurate locations. For Example, where the first parameter is an End Date on the "a" and the second parameter is Start date on the "b"
- Click on the Save Button, This will closes the Set Value pop-up window.
-
Click on the Save button to save the workflow. This will closes the window opened in Step 3.
As a result When you enter the details of the Tickets and you choose Picklist Ticket's status as "Closed", and update the start and end date, the Support Period field will be calculated and updated automatically.