This blog explains how we can trigger Power Automate based on a required condition.
Suppose you have a requirement where you want your flow to get triggered based on some condition. In this case, you can check the condition on the “Trigger” itself rather than adding a new action to check that condition.
Use Case:
- Trigger flow when Lead is created and Lead Source Type is “Trade Show”
- Trigger flow when Lead is created and Flag is “Yes”.
- Trigger Flow when Lead is created, Lead Source Type is “Trade Show” AND Flag is “Yes”.
- Trigger Flow when Lead is created, Lead Source Type is “Trade Show” OR Flag is “Yes”.
Steps to be followed:
- Trigger flow when Lead is created and Lead Source Type is “Trade Show”
- Click on Ellipsis (…) –> Click on Settings

- Go to Trigger Conditions and Click on “+Add”

- Add condition.

@equals(triggerBody()?['leadsourcecode'],7)
NOTE: “Lead Source” is an option set field add the value of that option to check.

- After adding condition click on Done.
- Test your flow.

- Trigger flow when Lead is created and Flag is “Yes”.
Repeat step number 1 to 3.
NOTE: Flag is the “Two Option” field for two option set fields that use true or false in condition.
@equals(triggerBody()?['cf_flag'],true)

- Trigger Flow when Lead is created, Lead Source Type is “Trade Show” AND Flag is “Yes”.
Repeat step number 1 to 3.
AND Condition
@and(equals(triggerBody()?['cf_flag'],true), equals(triggerBody()?['leadsourcecode'],7))
- Trigger Flow when Lead is created, Lead Source Type is “Trade Show” OR Flag is “Yes”.
Repeat step number 1 to 3.
OR Condition
@or(equals(triggerBody()?['cf_flag'],true), equals(triggerBody()?['leadsourcecode'],7))