Dynamics 365 Articles

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

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

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

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

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.

952
Thanura Wijesiriwardena

0

thanurabw


Leave a Reply

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

Finding this useful? Please spread the word :-)

Follow by Email952
Facebook
Facebook
Google+
https://dynamics365society.uk/archives/2973">
LinkedIn