Extending Conditional Operators in Flow

If you have worked with Flow conditions, you would have noticed that the Flow designer filters the list of operators you can use based on the data type of the field. However this does not mean that you cannot use other operators on that particular field.

For instance if you use a Date/Time field on your condition, the designer would not give you the option to select the following operators:

  • greater than
  • greater than or equal to
  • less than
  • less than or equal to
Date field basic conditional operators
Basic conditional operators for a date field

However you can use operators that are not displayed in the basic mode. You can use the advanced mode to extend the Flow conditional operators.

Extend Conditions on Advanced Editor
Extend conditions on advanced editor

If you save and re-open the Flow, the extended operator is now displayed in the basic mode as well.

Extended conditions when re-opening
Extended conditions when re-opening

Here are the possible operators you can use in Flow:

contains: contains(attributename,value)

does not contain: not(contains(attributename,value))

equals: equals(attributename,value)

does not equal: not(equals(attributename,value))

starts with: startsWith(attributename,value)

does not start with: not(startsWith(attributename,value))

ends with: endswith(attributename,value)

does not end with: not(endswith(attributename,value))

greater than: greater(attributename,value)

greater than or equal: greaterOrEquals(attributename,value)

less than: less(attributename,value)

less than or equal: lessOrEquals(attributename,value)


Bonus Content:

Most of you who have worked with Flow would have come across situations where you had to use multiple or complex conditions in your flow implementations. One of the most time consuming aspects I found was implementing grouped conditions. One way to achieve this is to have multiple nested condition blocks. However this can get really messy if you have lots of conditions. The recommended way to achieve this would be to build your filter criteria in advanced mode and combine all conditions into one Flow condition step/block. I have noticed some users having difficulties building filter criteria in the advanced mode due to various reasons.

To simplify this process I decided to build a XrmToolBox plugin that can convert FetchXML filters to Flow conditions. The idea is to help the users by allowing them to build the conditions in D365 advanced find UI and export the FetchXML to the plugin and generate the equivalent Flow condition. This is currently in test mode and has the ability to convert some of the basic FetchXML conditional operators to Flow. I will publish this soon for everyone to use. But if anyone would like to help me test and give feedback prior to the release please feel free to contact me.

XRM toolkit plugin
Sneak peek of FetchXML to Flow condition converter plugin for XrmToolBox

P.S. Azure LogicApps (big brother of Flow) currently supports building grouped conditions using the designer (without having to use an advanced mode). Lets hope this is on the road map for Flow too.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s