web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

oData Filter query for dynamics 365

(0) ShareShare
ReportReport
Posted on by 144

Hi,

I'm having problems with a Flow that is trying to get a list of records from a custom entity in Dynamics 365.

The custom entity [Contact Roles] has a lookup column to the Contact entity and the field is called abs_ContactId.

A Contact can have multiple Contact Roles which is why the Contact lookup is on the Contact Role entity.

 

So I thought it would simply be a case of:

Get Contact that's being updated

Use the Contacts' Id to get a list of Contact Roles and then update a few fields on the Contact Roles entity.

Like below:

Query1.PNG

 

However, I get this message when I try the query above:

 

"status": 400,

"message": "A binary operator with incompatible types was detected. Found operand types 'Microsoft.Dynamics.CRM.contact' and 'Edm.Guid' for operator kind 'Equal'.",
 
Am I missing something obvious here? How do I get around this?
I have the same question (0)
  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: oData Filter query for dynamics 365

    Hey @McMonty 

     

    Can you place the contact dynamic content in single quotes and try again? something like: ab_Contactid eq 'selectcontacthere'

     

    Hope this helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • A Wennerwik Profile Picture
    144 on at
    Re: oData Filter query for dynamics 365

    Hi, 

    yes, tried that as well with no luck.

  • yashag2255 Profile Picture
    24,695 Super User 2024 Season 1 on at
    Re: oData Filter query for dynamics 365

    Hey @McMonty 

     

    Can you share a screenshot of the error? what does  it look like? Can you try this out: remove the filter from there and add 1 to the topcount. This will get you a single record and you can check the name of the field to confirm if it is the abs_Contactid or something else?

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-bacao-msft Profile Picture
    on at
    Re: oData Filter query for dynamics 365

     

    Hi @McMonty ,

     

    You could consider directly using Condition to filter records and update, like:

    50.PNG

    In addition, you can set the Degree of Parallelism to improve the efficiency of Flow execution.

    49.PNG

     

    Best Regards,

  • v-bacao-msft Profile Picture
    on at
    Re: oData Filter query for dynamics 365

     

    Hi @McMonty ,

     

    In addition, you can get the file name here to configure in Filter Query.

    51.PNG

    Like:

    52.PNG

     

    Best Regards,

  • A Wennerwik Profile Picture
    144 on at
    Re: oData Filter query for dynamics 365

    Hi, here's the Body text:

    {
    "status": 400,
    "message": "There is an unterminated string literal at position 54 in 'abs_ContactId eq '8c028466-7530-41f7-bd90-6f67387e287b'.",
    "source": "xxxlive.crm11.dynamics.com",
    "errors": [],
    "debugInfo": "clientRequestId: f8f6aae9-a8c2-4cfb-bbfc-66ce9dcb3031"
    }
     
     
  • A Wennerwik Profile Picture
    144 on at
    Re: oData Filter query for dynamics 365

    Hi, 

    I get the message below if I simply type the id in: 

    abs_contactid eq '43838B79-9826-4F65-A81F-0B03358048DE'

     
    {
    "status": 400,
    "message": "Could not find a property named 'abs_contactid' on type 'Microsoft.Dynamics.CRM.abs_contactemail'.",
    "source": "xxxlive.crm11.dynamics.com",
    "errors": [],
    "debugInfo": "clientRequestId: e2bb127d-fb43-4fa1-a470-96f47b823a56"
    }
     
    That field exists on the entity which makes the above message even more confusing. Could it be something to do with that it is a lookup field?
  • Verified answer
    Jcook Profile Picture
    7,779 Most Valuable Professional on at
    Re: oData Filter query for dynamics 365
    Hello,

    I have had this issue before. Use the Dynamics 365 Connector.

    For some reason I have found it difficult in writing lookups using CDS connector.

    Note: when using dynamics connector refer to my solution in this post to find the lookup field

    https://powerusers.microsoft.com/t5/General-Power-Automate/Filter-Query-in-List-Records-not-working-for-Lookup-fields/m-p/391917#M33199

    --Josh

    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
  • Verified answer
    A Wennerwik Profile Picture
    144 on at
    Re: oData Filter query for dynamics 365

    Hi @Jcook 

     

    I just discovered that. It's a bit weird since a few months ago you were told to use CDS for more flexibility 🙄.

    Anyway, thanks for the reply 🙂

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard