cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmcdivitt
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
dmcdivitt
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
v-yuazh-msft
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

dmcdivitt
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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (47,241)