One of the important steps in Flow is the Condition. By supplying the conditions for your Yes and No branches you can make a flow a run a set of steps or a different set of steps.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 condition empty

In its simplest form you choose two values and an operation.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 1is1

But there is a lot more to the conditions. In this post I’m slowly going to build things up.

Basic Operations

The interface offers you 12 operations which can be used to compare values.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 operations

But there is a lot more. The get the the more advanced options  we will have to switch to the advanced mode.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 advanced condition

I’m still keeping my comparisons relatively simply by comparing 1 to 1 and 2 to 2 as I want to keep the examples simple. But you could use any of the Flow functions available as long as the result is a Yes/No. If you find that you need a non Yes/No condition then you might need to use a switch instead.

Nested conditions

Within Flow you can create nested conditions. As shown below you would have 3 different branches that could run some steps. I’ve seen many flows where conditions nested conditions have been added while only 1 branch has steps included.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 nested

Although, during debugging the above might make sense as you can see the results of each condition. For performance reasons it might help to bundle the conditions by using functions like or and and.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 debugcondition

Dynamic content

Rather than just using values in your conditions (which is pretty boring and useless!) you can also add dynamic bits in your conditions.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 dynamiccontent

While your running in basic mode you will see the link Add dynamic content which helps you doing all the complicated stuff. In advanced mode however this link disappears.

Depending on the actions above the condition that you are configuring you can click on the Dynamic content elements.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 dynamiccontentcondition

When looking at the above Date that came from the Manually trigger a flow trigger in advance mod, it becomes clear that all flow does is make it easy to find the Flow functions.

My conditional love in Microsoft Flow Microsoft Flow, Microsoft Office 365 advancedcondition

Looking at the documentation for triggerBody and equals it becomes quite easy to understand the options available within the condition:

 

triggerBody

Return a trigger’s body output at runtime. Shorthand for trigger().outputs.body. See trigger().

triggerBody()
Return valueTypeDescription
trigger-body-output>StringThe body output from the trigger

and

equals

Check whether both values, expressions, or objects are equivalent. Return true when both are equivalent, or return false when they’re not equivalent.

equals('', '')
ParameterRequiredTypeDescription
object1>, object2>YesVariousThe values, expressions, or objects to compare
Return valueTypeDescription
true or falseBooleanReturn true when both are equivalent. Return false when not equivalent.

There is more however. To collect information from previous steps there are a few more functions that are important. Just to list a few:

Conclusions

Rather than just going for the drag and drop options in Flow. It is worth investing some time in reducing the number of conditions just to ensure that the flow diagram is reduced in size. By reducing the number of conditions flows might be a bit more efficient but above all easier to understand as the overall diagram becomes smaller.

 

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

2 thoughts on “My conditional love in Microsoft Flow”
  1. Hi Peter,
    I’m quite sure you didn’t want to hide the documentation for triggerBody and equals functions behind HTML code 😉

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading