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 in power apps
Power Apps
Answered

Patch in power apps

(0) ShareShare
ReportReport
Posted on by 642

Hello Community Experts,

I have a custom order entity in my CDS, I have some products in my custom product entity, also i have the OOB account entity,

When i create an order, how do i make sure that the order created is for that particular account and the cutom products are added to my orders list

Its very urgent task I'm struggling with this, i tried a lot to resolve

Kindly guide

Best Regards

Sumaira

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Sumaira :

    Could you tell me:

    • What is the relationship between order\products\account?
    • Which record in the product (account) is associated with the newly created order and whether there are related matching rules?

    If there is a one-to-many or many-to-many relationship between entities, you can try the Relate function to associate them.

    I assume the relationship between order and account is N:1.Then try this code:

     

    Patch(orders,Defaults(orders),{Name:"Order5"});/*Ceate a new order*/
    Relate(
     LookUp(OOBaccounts,Name="Bof").orders, /*Specify account "bof"*/
     Last(Sort(orders,'Created On',Descending)) /*Get the last created order*/
    )

     

    Best Regards,

    Bof

     

  • Sumaira Profile Picture
    642 on at

    Thanks I'll try it @v-bofeng-msft 

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Sumaira  :
    Has the problem been solved?
    Is there anything else I can help?
    If my post helps, then please consider Accept it as the solution to help others.Thanks
    Best Regards,
    Bof

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard