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 / Inserting x related re...
Power Apps
Answered

Inserting x related records - model driven app

(0) ShareShare
ReportReport
Posted on by 32

Hi

 

Hope that someone can help me to solve this.

 

I have a custom entity called promotion and a one2many relationship to an entity called Promotion2Products which has a relationship to the Product entity.

 

The customer now wants to be able to add all products with a specific brand or sub category to a promotion.

 

Should that be done via flow/powerautomate or canvas app or ?

 

I am using a model drive app now to create promotions and have a grid in the form for a promotion that lists all products in the promotion - and can add one product at a time using a quickcreate form.

 

Thx in advance

/Erik Svensen

I have the same question (0)
  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @donsvensen,

    Good question and there are many schools of thought with no right or wrong solution in my opinion.

    • If you need to capture the brand or category the promotion relates to then Power Automate makes sense. You can add a lookup field on brand and/or category and have a flow that triggers when that field gets set (on create and update). The only tricky part is you'll need to manage when the brand/category changes. Should you clear existing products and reload? Or keep existing and just add new ones, etc
    • If you only need the ability to multi select and search products by brand/category which then associates them to your promotion then an embedded canvas app is a valid an option because model-driven apps doesn't support this out-of-the-box due to the custom N-N relationship (i.e. Promotion2Products) configured. 
    • You can use out-of-the-box N-N relationship to map promotions to products which would then allow you to associate/dissociate in bulk (i.e. by brand or category) but the user would to have to filter and select the products. The main disadvantage with out-of-the-box N-N relationship is that you can't have additional fields to the relationship; you're more restricted.
    • There are other options such as the following, but the base solution is similar to the ones above, the difference is more on the user experience side.
      Have a command bar button to add products by brand/category. Clicking the button can either open a canvas app (similar to the embedded app) or open quick create on a new entity named something like "Add Product Request". Upon create of "Add Product Request", triggers a flow that would then associate the products based on the request and then close the request by setting the status to complete.

    I think these are the top options that come to mind besides taking the custom route.

    Hope this helps!

     

  • Ben Thompson Profile Picture
    1,400 on at

    The other solution that Eric doesn't cover is using a PCF component to map the entities https://pcf.gallery/categories#many%20to%20many lists 3 possible options that may be suitable NN Checkboxes, N to N Multiselect and NN Tags

     

    The advantage of using a PCF component is that you don't need to worry about a canvas app everything is done within the subgrid on the Product and Promotion forms and it should work both ways.

     

     

  • Verified answer
    Erik Svensen Profile Picture
    32 on at

    thx to @ben-thompson @EricRegnier for getting back and providing valuable solution ideas.

     

    I decided to go with a canvas app and a N:N relationship.

     

    donsvensen_0-1598625773455.png

    And by using a combination of ForAll and Relate function the result turned out ok

     

    Thx again for the support

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard