Common Data Service, Flow, Power Automate

CDS current connector: Filter expression. My Flow doesn’t trigger!”

I thought you will love this one. It’s that type of “Help! My Flow hasn’t get triggered” thing which we all love.

How to reproduce

For the CDS entity which has some existing records then a new optionset field has got created. As a result some records may not have this field populated.

If you use Filter expression “[your_attribute] ne [some_value]” it won’t trigger for records where this attribute is equal to null.

For example, I’ve got a list of Jobs with the Type field populated for some records. Now I want to run a Flow which creates a Task every time I update a record if Job Type doesn’t equal to “Repair”

List of Jobs with Type field populated for some records.

This is my Flow trigger and I am trying to run my Flow only for records which aren’t “Repair” type.

CDS current environment Update trigger with Filter expression for Job Type not equal to Repair.
The selected Job has Job Type equal to null.

The selected job Type is not equal to “Repair” so expect Flow to trigger on the change of the record. But it doesn’t. My previous job run is for the Type populated.

Successful update trigger for the record with the type Drive

Let’s create a new record with the type not “Repair”.

Job with the type Organise

Then we update the Description.

Update the Description to trigger the Flow
Flow triggered for the record with the type not equal to null

The Flow was successfully triggered.

For Organise Job Type Flow has triggered.

What’s the cause

I believe (I might be wrong though) that “null” means it’s not there. So you can’t really check if it matches the condition because it is physically not present in the dataset. If you look at JSON you for attribute which is “null” it’s not present in the JSON and marked as “null” it’s simply not there.

What’s the solution

There is none. Kidding. If you run for data with nulls and you want it to be triggered don’t use Filter expression. For this case you have to use a Condition action inside your Flow. It can be the first step in the Flow.

Happy days!

2 thoughts on “CDS current connector: Filter expression. My Flow doesn’t trigger!””

Leave a Reply

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

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

Facebook photo

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

Connecting to %s