cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
McMonty
Level: Powered On

oData Filter query for dynamics 365

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?
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

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

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




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!





View solution in original post

McMonty
Level: Powered On

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 🙂

View solution in original post

9 REPLIES 9
Dual Super User
Dual Super User

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!

McMonty
Level: Powered On

Re: oData Filter query for dynamics 365

Hi, 

yes, tried that as well with no luck.

Dual Super User
Dual Super User

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!

Community Support Team
Community Support Team

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
McMonty
Level: Powered On

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"
}
 
 
McMonty
Level: Powered On

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?
Super User
Super User

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

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




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!





View solution in original post

McMonty
Level: Powered On

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 🙂

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,926)