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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Canvas App embedded in...
Power Apps
Suggested Answer

Canvas App embedded in Model Driven App Form - Patch with Lookup Column

(1) ShareShare
ReportReport
Posted on by 892
Hi All - I have a canvas app that I am embedding in a model driven app form with a patch statement. one column in the table is a lookup column I can't seem to get the lookup column to populate on the form or update in the Patch statement. is this a limitation of embedded apps?   It app controls work outside of the form 
 
Approver Branch is my lookup column 
 
 
Patch(
    'AP Location Approvers',
    LookUp(
        'AP Location Approvers',
        LocationApprovers = GUID(cmbnewprimary.Selected.LocationApprovers)
    ),
    {
       ApproverBranch:
       LookUp('AP Locations',xxxxx_apbranchlocationid=GUID(DataCardValue4.Selected.xxxxx_apbranchlocationid)),
       
        'Approver Level': 1,
        LOC: DataCardValue5.Text,
        IsPrimary:true
    }
);
 
 
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    3,299 on at
     
     
    Lookup columns require a specific object structure in Patch: To update a lookup column, we must patch it with an object containing the lookup's GUID and entity type, typically like this:
     
    Patch(
        YourTable,
        Defaults(YourTable),
        {
            LookupColumn: {
                '@odata.type': "#Microsoft.Dynamics.CRM.<entitylogicalname>",
                Id: LookupRecordGUID
            }
        }
    )
    
     
     
    In Dataverse (and Power Apps), to patch a lookup column, you must provide an object with the @odata.type and the GUID of the related record, like this:
     
     
    Patch(
        'AP Location Approvers',
        LookUp(
            'AP Location Approvers',
            LocationApprovers = GUID(cmbnewprimary.Selected.LocationApprovers)
        ),
        {
            ApproverBranch: {
                '@odata.type': "#Microsoft.Dynamics.CRM.<entitylogicalname>",
                Id: GUID(DataCardValue4.Selected.xxxxx_apbranchlocationid)
            },
            'Approver Level': 1,
            LOC: DataCardValue5.Text,
            IsPrimary: true
        }
    );
    
     
    Replace <entitylogicalname> with the logical name of the entity that ApproverBranch looks up to (e.g., "account", "contact", or your custom entity logical name).
     
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    11manish Profile Picture
    2,487 on at
    The first thing I'd test is:
    • ApproverBranch: DataCardValue4.Selected
    because in Dataverse lookup patches, passing the selected record directly is usually the correct approach.
     
    If that still fails, inspect JSON(DataCardValue4.Selected) to confirm the control is returning a Dataverse record from AP Locations rather than a custom record
     
    or collection.
     
    That will quickly reveal whether the issue is a lookup schema mismatch rather than a limitation of embedded Canvas Apps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 430

#2
timl Profile Picture

timl 318 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard