cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Filter Query in List Records not working for Lookup fields

Hi PowerUsers,

I am trying to list/get records from CDS "Leave Request" entity on the basis of a WorkerID.
WorkerId is a lookup field in "Leave Request" entity, making relation with "Worker" entity.

When i am applying the below filter query in List records action of CDS i'm getting the following error.

Screenshot_1.png


ERROR:

A binary operator with incompatible types was detected.
Found operand types 'Microsoft.Dynamics.CRM.cdm_worker' and 'Edm.Guid' for operator kind 'Equal'

I have tried passing the GUID without qoutes around it as well but still same issue.

Basically anydata type i am putting against the lookup column it is returning me the same error.
What datatype should be put againts lookup field to fetch data ?
 
Looking forward to swift and helpful response.
Regards,
Ali Nawaz
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hello @Ali_Nawaz ,

The best way I found how to make the Filters work on Dynamics is to:

First run the Flow with List Dynamics action without the filter.

Second check the results of the Flow run, and look for the value you wish to be filtering on.

Third copy the field name without quotes and use that as the filter.

 

Note that Lookup Fields may be the reason your filters are not working. For example in my screen captures the field name of the filter I am trying to use is {cr9ce_taskowner} but because it is a lookup when I did the List all records I found that the field I need to filter on is {_cr9ce_taskowner_value}.

 

Filter pic1.pngFilter pic2.png

 

Also try using List instead of Get

 

Hope this helps

 

--Josh





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

9 REPLIES 9
Highlighted
Super User III
Super User III

Hello,

 

I know this is going to sound strange but CDS action in Flow is broken, most of the features do not work properly, including filter.

Use the Dynamics 365 connector instead. It has everything you need to do with CDS.

 

 I found this out the hard way when trying to do multiple things with CDS connector becuase i am passing data from PowerApps to flow and wrtting and getting records all with flow.

 I have saved 2 of my colleagues last week about this after spending hours, than realizing most of CDS connector does not work.

CDSFlowNo1.pngCDSFlowNo2.png





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

Hi @Jcook 

I tried using the Dynamics 365 connector but I am still getting the same error as CDS connector 

 

A binary operator with incompatible types was detected.
Found operand types 'Microsoft.Dynamics.CRM.cdm_worker' and 'Edm.Guid' for operator kind 'Equal'.
Highlighted

Hello, You also tried without quotes on Dynamics connector as well?

-Josh




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted

Hello @Ali_Nawaz ,

The best way I found how to make the Filters work on Dynamics is to:

First run the Flow with List Dynamics action without the filter.

Second check the results of the Flow run, and look for the value you wish to be filtering on.

Third copy the field name without quotes and use that as the filter.

 

Note that Lookup Fields may be the reason your filters are not working. For example in my screen captures the field name of the filter I am trying to use is {cr9ce_taskowner} but because it is a lookup when I did the List all records I found that the field I need to filter on is {_cr9ce_taskowner_value}.

 

Filter pic1.pngFilter pic2.png

 

Also try using List instead of Get

 

Hope this helps

 

--Josh





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

Highlighted

@Jcook 
Thanks Man it worked. 

I had done this before with other columns but didn't try to query lookup fields with the "_value" attribute.
Thanks again for your input, really appreciate it  🙂 

Best Regards, 
Ali Nawaz.

Highlighted

My issue is that I do not want to match the GUID of the Lookup column, rather I want to match the value the GUID is referring to. How do I connect to the referenced value in the filter query of the CDS list records Power Automate(Flow) component?

Highlighted

@Jason_Chop 

 

Unfortunately the Odata filter used in these actions does not allow the _value to be accessed. You can see it in a list records but cannot filter on it.

 

My suggestion is to use your list records with no filter. Than under that action, use a Filter array action. Pass in the value of the List records and build your filter on the column with _value 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
New Member

Hello Ali,

 

You can try _cdm_workerid_value eq 'GUID'. Please note the red highlighted part. 

 

Hope this will work.

Highlighted

I can confirm that this solution works.  Went round and round, encountering each of these errors until trying out Josh's solution.

 

Here's what my flow ended up looking like:

samschad_0-1593432888321.png

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (4,052)