cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisgreen
Frequent Visitor

Ambiguous binding present on Patch

Hey all,

New to PowerApps, and thankful for these forums. Great community and the support / tips & tricks have been invaluable in learning the platform.

 

I've spent a ton of time searching this issue, but haven't been able to find a solution. Here's a quick synopsis.

  • PowerApp connected to CDS
  • Custom entity (Approvals) with Notes enabled
  • Data connection to both Approvals and Notes within the PowerApp

I'm trying to give users the chance to add notes to the Approval record they're working with (text input), but I'm running into a snag when my formula runs.

 

Here's my code: 

Patch(Notes,Defaults(Notes),{
    notetext:NotesInput.Text,
    objecttypecode:"approvals",
    _objectid_value: Gallery1.Selected.Approval,
    subject:"New Note Added"
    });

The error I'm getting is:

The requested operation is invalid. Server Response: Ambiguous binding is present. Resolve by sending lookup_type property.

As far as I can tell, I'm sending the right field values, but I haven't been able to make this go away. I've checked the relationship in the CDS and all looks right. All my field names and values have been verified in Excel. When I had a note through a model-driven app, all the values (particularly objecttypecode) match what I'm trying to send.

 

Any thoughts or suggestions, or places to check would be appreciated! Happy to put in the leg work and dig up the solution myself, but I'm stuck and need some hints.

 

Thanks all!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Kris,

Thanks for the link. I had seen that post before with no luck, but it indirectly gave me the answer.

 

When I switched "objecttypecode" to "_objectid_type", I got a different error: "invalid lookup_type value"

 

I noticed that all the examples use "contacts" or "accounts", which led me to look at my custom entity naming schema. Another post I found mentions using the plural of the entity schema name. In the case of Contacts or Accounts, the schema name is "account" and "contact", but the code references "accounts" and "contacts".

 

In the case of my custom entity, I had already made the schema name plural: "approvals" -- As soon as I set my code like:

_objectid_type: "approvalses"

It started working. A little more research to realize that these queries use the "EntitySetName" which gets generated as a plural (my best guess). Confirmed using the metadata browser.

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/browse-your-metadata

 

A lesson in using proper naming conventions.

 

Thanks!

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @chrisgreen,

Could you please share more details about the error message on your side?

Based on the formula that you provided, I have made a test, the issue is confirmed on my side.

The user @DChrisPhillips has faced similar issue with you, please check the response from PowerApps Staff @bsimons within the following thread:
https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/How-do-I-update-CDS-Contact-entity-...

Please consider take a try to modify your formula as below:

Patch(Notes,Defaults(Notes),{
    notetext:NotesInput.Text,
    _objectid_value: Gallery1.Selected.Approval,
    _objectid_type: "approvals",  /*<-- Add formula here */
    subject:"New Note Added"
})

then check if the issue is solved.

 

Best regards,

Kris

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

Hi Kris,

Thanks for the link. I had seen that post before with no luck, but it indirectly gave me the answer.

 

When I switched "objecttypecode" to "_objectid_type", I got a different error: "invalid lookup_type value"

 

I noticed that all the examples use "contacts" or "accounts", which led me to look at my custom entity naming schema. Another post I found mentions using the plural of the entity schema name. In the case of Contacts or Accounts, the schema name is "account" and "contact", but the code references "accounts" and "contacts".

 

In the case of my custom entity, I had already made the schema name plural: "approvals" -- As soon as I set my code like:

_objectid_type: "approvalses"

It started working. A little more research to realize that these queries use the "EntitySetName" which gets generated as a plural (my best guess). Confirmed using the metadata browser.

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/browse-your-metadata

 

A lesson in using proper naming conventions.

 

Thanks!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,443)