Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

How to add new record when 2 items are selected on submission of record

(0) ShareShare
ReportReport
Posted on by 11
Hey all,

I have a scenario where i have an app where my user base submits leads for instrument products within my company. They have the ability to select multiple products as each product is set up as it's own individual field within my common data service entity. The problem actually comes in when they select multiple products as it will only submit one row into my database.

Does anyone know if there is a way to basically 'Split' the one submission into 2 rows? I've looked at a few options via Microsoft Flow but haven't had much luck so far.

Any help suggestions are more than welcome.

Thanks all.

Jamie
 
 
  • stephej Profile Picture
    11 on at
    Re: How to add new record when 2 items are selected on submission of record

    Thanks for your help @v-xida-msft

     

    To explain a little further:

     

    - All my data is contained within one entity which is called Lead Generation Details

    - Each of my product's are their own field. Each field has a field type of Boolean and displayed like shown below with my user input form:

     

    Product field type.jpg

     

     

    - When my user base is selecting an instrument (currently) will select which instrument they want to submit a lead on (see below). They can select as many instruments as they would like to just to add

    Instrument Selection.jpg

     

    - The good news is i already use the patch function (due to having 4 pages of input fields within one entity) though the bad part is when one of my users submits say more than 1 instrument within the one submission, it will come through as one record (as shown below)

    Record_One_Line.jpg

     

    What would be great to understand is there a way of automatically adding another record is more than 1 instrument is picked? Or do you have any other suggestions on maybe ways to approach this design?

     

    Thanks again @v-xida-msft

     

    Jamie

     

  • v-xida-msft Profile Picture
    on at
    Re: How to add new record when 2 items are selected on submission of record

    Hi @stephej,

    Could you please share a screenshot about your app's configuration?

    How do your users select multiple products within your app? How does your app submit the selected product?

    Do you use a Gallery to list all product records of your CDS Entity within your app?

    If you want to submit multiple records (product records) into your CDS Entity, I think the ForAll function and Patch function could achieve your needs.

    Please check and see if the following thread would help in your scenario:

    https://powerusers.microsoft.com/t5/General-Discussion/How-to-bulk-update-with-ForAll-or-Patch/td-p/9330

    More details about Patch and ForAll function in PowerApps, please check the following article:

    Patch function

    ForAll function

     

    Best regards,

    Kris

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: How to add new record when 2 items are selected on submission of record

    Hi @stephej,

    it appears that you have a one to many relationship between leads and products. You need to have two tables. Please see my posts in the community blog for how to design your tables.

    I recently posted in the creating apps forum on a thread titled

    • “Add values in a one to many connection”

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
Fubar Profile Picture

Fubar 11 Super User 2025 Season 1

Overall leaderboard

Featured topics