cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
McMonty
Resolver I
Resolver I

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

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!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

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
yashag2255
Dual Super User II
Dual Super User II

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!

Hi, 

yes, tried that as well with no luck.

yashag2255
Dual Super User II
Dual Super User II

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

 

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.
v-bacao-msft
Community Support
Community Support

 

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.

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

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

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!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,949)