Microsoft Flow custom conditions with logical operators (and, or)

If you recently started using Microsoft Flow to compose some workflows and manage a few processes like me (such as recording tweets about your company – or any other topic that is important to you – into an Excel sheet for reviewing later), you might have encountered this “issue”:

  • creating nested conditions isn’t nice, at least visually, as it clutters your flow diagram (e.g. checking multiple things before acting may turn into a set of ugly nested condition rectangles hiding the actual action executed when all tests pass).

To resolve the nested conditions or to use other logical operators instead (e.g. or), you can define custom code for the condition by editing condition in Advanced mode. For example, this condition code placed after a Twitter retrieval action checks that the tweet is original (not a retweet) and that its language is English:

@and(equals(triggerBody()?['RetweetCount'], 0), equals(triggerBody()?['TweetLanguageCode'], 'en'))
Advertisements

About Sorin Dolha

My passion is software development, but I also like physics.
This entry was posted in Development, Miscellaneous and tagged , , , . Bookmark the permalink.

Add 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 )

Google+ photo

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

Connecting to %s