cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dmcdivitt
Level 8

list records, how do I enter the filter query for all with same lookup field

I have two custom Dynamics 365 entities: Pharmacy_History and Pharmacy_Contact. Pharmacy_History references Pharmacy Contact as a lookup field. When a Pharmacy_History record is created or updated a flow is triggered. In the flow I need to list all history records having the same contact. Some calculations will be done to update the Pharmacy_Contact record.

The schema name in Pharmacy_History for the field is dhs_Contact and display name Contact. The Dynamic Content pane lists fields coming from the triggering record. The filter query should contain something similar to:

dhs_Contact eq (Contact from Dynamic Content)

The error created when the flow runs says:

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

I tried using cast, but an error says cast is not available. I tried concatinating to make a string on each side but cannot figure out the syntax. I'm not able to find an answer for this after reading many pages.

 

1 ACCEPTED SOLUTION

Accepted Solutions
dmcdivitt
Level 8

Re: list records, how do I enter the filter query for all with same lookup field

The correct syntax for Filter Query in the List Records control is:

       dhs_Contact/dhs_pharmacycontactid eq (Contact from Dynamic Content)

 

This will create a list of all Pharmacy_History records having the same Pharmacy_Contact as the history record updated or created.

The forward slash allows a field within the entity record to be specified, and dhs_pharmacycontactid is the name of the field.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: list records, how do I enter the filter query for all with same lookup field

Hi @dmcdivitt,

 

Please take a try to use the "Filter Array" action to filter the records to achieve your needs.

 

Best regards,

Alice

dmcdivitt
Level 8

Re: list records, how do I enter the filter query for all with same lookup field

The correct syntax for Filter Query in the List Records control is:

       dhs_Contact/dhs_pharmacycontactid eq (Contact from Dynamic Content)

 

This will create a list of all Pharmacy_History records having the same Pharmacy_Contact as the history record updated or created.

The forward slash allows a field within the entity record to be specified, and dhs_pharmacycontactid is the name of the field.

View solution in original post

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,433)