cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

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
Resolver I
Resolver I

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
Community Support

Hi @dmcdivitt,

 

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

 

Best regards,

Alice

Resolver I
Resolver I

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (6,476)