Skip to main content
Community site session details

Community site session details

Session Id : iAxW7sKDhTgAOUDGXx4m8v
Power Apps - Building Power Apps
Answered

Save record to multiple entities in Model Driven App?

Like (0) ShareShare
ReportReport
Posted on 22 Jul 2020 03:54:57 by 292

Hi everyone,

I'm looking to integrate my canvas app into a model driven app. In the model driven app, is it possible to save a single record to multiple entities?

  • Verified answer
    v-xida-msft Profile Picture
    on 22 Jul 2020 at 05:54:59
    Re: Save record to multiple entities in Model Driven App?

    Hi @karimabdelrazek ,

    Could you please share a bit more about your scenario?

    Do you want to use your Model-Driven app or the embedded canvas app to save a single record back to multiple entities?

     

    If you want to use Model-Driven app to save single one  record back to multiple entities, I afraid that there is no direct way to achieve your needs. Currently, a Entity form in Model-Driven app could only be bind to single one Entity, which could not save value back to multiple Entities.

     

    If you want to use the embedded canvas app in your Model-Driven App to save a single record back to multiple entities, I think it is possible. Within this embedded canvas app, you need to add your multiple Entities as data source in this canvas app firstly. And then you could use the Patch function to patch single one record back to multiple Entities.

    The Patch formula example as below:

    Patch(
     Entity1,
     Defaults(Entity1),
     {
     Column1: "xxxx",
     Column2: "xxxx",
     ...
     }
    );
    Patch(
     Entity2,
     Defaults(Entity2),
     {
     Column1: "xxxx",
     Column2: "xxxx",
     ...
     }
    );
    Patch(
     Entity3,
     Defaults(Entity3),
     {
     Column1: "xxxx",
     Column2: "xxxx",
     ...
     }
    );
    ...
    ...

    Within above Patch formula, you could also reference the column value from your Model-Driven app form through the ModelDrivenFormIntegration.Item property. For example, you could modify above formula as below:

    Patch(
     Entity1,
     Defaults(Entity1),
     {
     Column1: ModelDrivenFormIntegration.Item.Refernece_Col1,
     Column2: ModelDrivenFormIntegration.Item.Refernece_Col2,
     ...
     }
    );
    Patch(
     Entity2,
     Defaults(Entity2),
     {
     Column1: ModelDrivenFormIntegration.Item.Refernece_Col1,
     Column2: ModelDrivenFormIntegration.Item.Refernece_Col2,
     ...
     }
    );
    Patch(
     Entity3,
     Defaults(Entity3),
     {
     Column1: ModelDrivenFormIntegration.Item.Refernece_Col1,
     Column2: ModelDrivenFormIntegration.Item.Refernece_Col2,
     ...
     }
    );
    ...
    ...

    Patch function in canvas app

     

    More details about embedding canvas app in PowerApps, please check the following blog:

    https://powerapps.microsoft.com/en-us/blog/announcing-the-general-availability-of-embedded-canvas-apps-in-model-driven-forms/

     

    Please try above solution, hopes it could help in your scenario.

     

    Regards,

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete