Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

unable to make filter query for list records

(0) ShareShare
ReportReport
Posted on by

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.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: unable to make filter query for list records

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: unable to make filter query for list records

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

  • v-yamao-msft Profile Picture
    on at
    Re: unable to make filter query for list records

    Hi @Anonymous,

     

    Are you working with dynamic 365 histories entity?

    The screenshot I provided is:

    1.PNG

     

     

    Best regards,

    Mabel

  • Community Power Platform Member Profile Picture
    on at
    Re: unable to make filter query for list records

    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.

  • v-yamao-msft Profile Picture
    on at
    Re: unable to make filter query for list records

    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.

    1.PNG2.PNG

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492