My app has the three entities Pharmacy_Contact, Pharmacy_History, and Pharmacy_Action. When a history record has been created or updated I need to cycle through all history records for the contact, get the action record associated with the history record, then finally update a status in the contact record with a computed value. In list records I'm unable to construct the filter query correctly. The schema name for the field is dhs_Contact and the display name is Contact. It is a look up field. In the dynamic content list the history fields are enumerated. I assume I should choose Contact and have it place that in filter query, follow with eq, then whatever value is passed from the trigger event. I can't figure out how to get the value to put after eq. All history records returned will have the same contact value, and, it will be the same contact value of the history record changed by the user. See attached screen snapshot.
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.
Thanks for the effort, Mabel. It is appreciated. Pharmacy History and Pharmacy Contact are custom entities. The field dhs_Contact is a lookup field in Pharmacy History saying what Pharmacy Contact the history record belongs to, and contains a GUID. The display name is Contact. The name field is not used in Pharmacy History.
The flow is triggered by a Pharmacy History update. Because of that, the Pharmacy History record just updated is present in Dynamic Content values I want to find all histories having the same contact, so, for the filter query in the list records control, I need something like:
dhs_Contact eq (Contact from Dynamic Content)
I have done trial and error and can see the GUID value for (Contact from Dynamic Content) as a string value in the error message displayed when the flow fails. An error similar to the following occurs:
A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Microsoft.Dynamics.CRM.dhs_pharmacycontact' for operator kind 'Equal'.
Hi @Anonymous,
Are you working with dynamic 365 histories entity?
The screenshot I provided is:
Best regards,
Mabel
Mabel,
Thanks for replying. I agree the Dynamic Content contact value is a GUID. Information in Dynamic Content is passed from the triggering event. What I need to know is how to compare that with values contained in history records. I need to know what to place in the filter query text box for the list records control. The flow is triggered when editing a history record, which means information for that history record is present in Dynamic Content. I need to find all history records having the same contact value.
I'm not able to read the screen snapshot you posted even after saving the image and zooming in.
Hi @Anonymous,
Dynamic content Contact is a unique identifier of the Contact, it will return a GUID but not a specific name.
To know the extract return value of a dynamic content, please try to use Compose action.
I have made the following test, I am going to filter records that the firstname is “Vincent”. Please check the following screenshot for a reference.
Besides, more details about Odata Filter query, please check the following doc for a reference:
https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)
Best regards,
Mabel
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492