Workflow If else expression 

To avoid generating multiple workflows in updating a record in a single field, instead, you can make utilize an if-else statement.

For example: To update the Probability field as a Opportunities Sales Stage changes.

To begin creating an if-else statement follow the steps given below:


1. Go to CRM Settings >> Automation >> Workflows.
2. 
Click on "New Workflow" on the top right corner of the page.

Enter the Basic Information.

3. Enter the "Workflow Name".
4. Provide the "Description".
5. Select the "Target Module" as Opportunities.
6. Select the "Status" as Active.

Choose the Workflow Trigger.

7. Select the Workflow Trigger - Opportunities updated (Include Creation).
8. From "Recurrence" select Every time conditions are met.

Set up Workflow action.

9. Click on "Add Action".
10. Select "Update Fields" from the drop-down >> It opens an "Add Action for Workflow Update Fields window".
11. Enter the "Action Title".
12. In the "Set Field Values" >> Click on "Add Field".

13. Select the Field From the dropdown as Probability >> Click on the next box.
14. In the "Set Value" popup >> Select the option "Expression" from the dropdown.



15. Copy and paste the Expression in the text field.



 The expression is as follows: if Sales_Stage=='New' then 10 else if Sales_Stage=='Qualification' then 20 else if Sales_Stage=='Demonstrations' then 40 else if Sales_Stage=='Prepare Estimation' then 50 else if Sales_Stage=='Estimation Sent' then 70 else if Sales_Stage=='Negosiation' then 80 else if Sales_Stage=='Closed Won' then 100 else if Sales_Stage=='Closed Lost' then 0 end





16. Click on the Save button.


 








































Was this article helpful?

Can't find what you're looking for? Submit Ticket