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 / Patch a CDS Lookup Fie...
Power Apps
Unanswered

Patch a CDS Lookup Field in Enitity1 with an AutoNumber field value from Entity2

(0) ShareShare
ReportReport
Posted on by 2

Greetings,

 

Would you be able to advise the following patch related function:

How I may patch a Lookup field (with field name as 'Entity1ID') in a CDS entity known as Entity#1 (a child entity) with the value from the primary field known as 'ID' (Auto Number data type) from a second CDS entity known as Entity#2 (a parent entity for one-to-many relationship)? 

 

My goal is to fill in the forms for both Entity#1 and Entity#2 simultaneously in two separate Edit Forms but on the same screen, after user finishes entering the inputs on both forms, use the Select button to let CDS perform the following in sequential order:

(i) Submit Form2 to the parent entity (Entity #2) first --> the CDS will generate the ID (record number) in Entity#2,

(ii) use the Patch function to patch the 'ID' value of the record just created in Entity#2 with Form2.LastSubmit.'ID' to the 'Entity1ID' field in Entity#1 (child entity).

(iii) Submit Form1.

 

Please advise the syntax required for the patch function with an example if possible.

Thanks in advance for your help.

 

Regards,

 

Albert

Categories:
I have the same question (0)
  • Erica0214 Profile Picture
    on at

    @test3ncea ,

     

    When you patch form1, you can use the patch with a lookup function and if from the LastSubmit.

     

    Please refer to this thread, which is good example and solution. 

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-a-CDS-Lookup-column-within-PowerApps/m-p/174190/thread-id/58032#M58033%C2%A0

     

    Hope it helps.

     

    Regards,

    Erica

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard