Filtering in Cloud Flows by Enums from Dynamics 365 FO

You want to use data from Dynamics 365 Finance and Supply Chain in Power Automate and filter there for so-called values in enums and get stuck?

Then I have a little tip for you.

To get the right name for the enum, I use a “List Items present in Table” action:

In this action I set the value for the filter query to the field and the value I want to filter. Here in my example I want to filter the entity SalesOrderHeadersV2 for open orders. The value for open orders is “Backorder” and is in the SalesOrderStatus field.

With this filter query, I’ll just run my Cloud Flow test.

The execution now runs on error because my filter query is not correct.

In the Error Details I now find the hint to my error

A binary operator with incompatible types was detected. Found operand types ‘Microsoft.Dynamics.DataEntities.SalesStatus’ and ‘Edm.String’ for operator kind ‘Equal’.

which now brings me the hint to the correct value in the filter query:

My correct filter must be here

SalesOrderStatus eq Microsoft.Dynamics.DataEntities.SalesStatus’Backorder’

because I want to filter on a value from an enum.

Now I run the flow again and voila, it runs through without error.

I hope this helps you.