IF function in Power Automate

Many times, in Power automate we set a variable based on some condition and to achieve that, we use condition control action, but we can avoid using action and use If function instead. This blog will guide you on how you can use If function instead to using condition control action.

Use Case:

When an Account is created in D365 CE, Initialize the variable and set its value as description. If description is unavailable, then set value as NA.

Steps:

  1. When an Account is created in D365 CE.

  2. Add a Compose action and enter if(equals(triggerOutputs()?['body/description'],null),'NA',triggerOutputs()?['body/description']) as expression in Input Field of connector.
  3. In above Step (2) it checks if description is null then set “NA” as output else set description as output.

  4. Initialize a variable of type string and set its value as Output of compose action.

  5. Create an Account and check if we get the desired result.
Enjoy!

Comments

Popular posts from this blog

Make D365 CRM Entity as Read only

Convert an Array to comma separated string in Power Automate

Trigger an Email when account is created in D365 CRM using Azure Logic App