Wednesday, 3 October 2018

Does not contain data and Does contain data in Flow

Another type of configuration that we are familiar with in Dynamics 365 workflows is Does not contain data and Contains data in a condition step. This is typically used to check whether a field is populated with data for the next workflow steps to take place.

When you use basic mode, you'll be presented with the click and select style you're familiar with in Dynamics 365 workflows however what is missing is Does not contain data and Does contain data.


It is not as obvious on how to achieve this in Flow compared to Dynamics 365 as the two are visible in Dynamics 365 workflows. 



Welcome to another WTF post on replicating Dynamics 365 workflow functionality in Flow!

Replicating Does not contain data

In Flow we have to edit in Advanced mode instead of using basic mode. I covered Advanced mode for AND OR statements in my previous blog so check it it out if you haven't already done so.

When you select the field you're after in basic mode, switch to advanced mode. Your expression will look something like this:


The expression to use for Does not contain data is

@empty(triggerBody()?['_productid_value'])
  • You replace the condition expression with empty 
  • Remove the comma 
  • Remove the field reference of  ' '
The step will now pass the function with the logic of checking that the field does not contain data, in other words is NULL.

Replicating Does contain data

To achieve the same for Does contain data, use an additional condition of not( ).

@not(empty(triggerBody()?['_productid_value']))

This will now pass the function with the logic of checking that the field does contain data, in other words is not NULL.

Summary

Use edit in Advanced mode to achieve Does not contain data or Does contain data in Flow. You'll need to enter the expression as outlined in this post within the Condition step in Flow.

Happy Flow'ing 🙂 #wtf #FlowFever

No comments:

Post a Comment