cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ali_Nawaz
Level: Powered On

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
Jcook
Level 10

Re: Filter Query in List Records not working for Lookup fields

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

View solution in original post

6 REPLIES 6
Highlighted
Jcook
Level 10

Re: Filter Query in List Records not working for Lookup fields

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

Ali_Nawaz
Level: Powered On

Re: Filter Query in List Records not working for Lookup fields

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'.
Jcook
Level 10

Re: Filter Query in List Records not working for Lookup fields

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

-Josh
Jcook
Level 10

Re: Filter Query in List Records not working for Lookup fields

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

View solution in original post

Ali_Nawaz
Level: Powered On

Re: Filter Query in List Records not working for Lookup fields

@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.

Jason_Chop
Level: Powered On

Re: Filter Query in List Records not working for Lookup fields

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?

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (6,054)