cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

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
 
 
3 REPLIES 3
Highlighted
Super User
Super User

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”
Highlighted
Community Support
Community Support

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/...

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

Patch function

ForAll function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

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

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (10,656)