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

Adding Rows to Form to batch submit

Hello,

I am working to a prototype for a quote generator.

In the prototype, there is a page which lets you submit a single line quote (i.e: one item), as a form.
I am wondering if it possible to add a button which creates a new row, so that I can create a multi line quote and submit all the lines at once.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi  ,

Could you please share a bit more about your scenario?

Do you want to add a button to add a new row, then you could submit multiple lines once time?

 

Based on the needs that you mentioned, I think the combination of Gallery control, Patch function and ForAll function could achieve your needs. I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

3.JPG

 

4.JPG

Set the OnStart property of the App to following:

ClearCollect(CurrentIndex, 1)

Add a Gallery control, set the Items proeprty to following:

CurrentIndex

add some Text Input box within this Gallery to collect user's input.

Add a "+" icon button, set the OnSelect property to following:

Collect(CurrentIndex,1)

Add a "Patch" button outside the Gallery, set the OnSelect property to following:

ForAll(
        Gallery1.AllItems, 
        Patch(
              'YourSPList', 
              Defaults('YourSPList'), 
             {
                Column1: TextInput1.Text, 
                Column2: TextInput2.Text,
                Column3: TextInput3.Text,
                ...
             }
       )
)

Note: The TextInput1, TextInput2, TextInput3, ... represents the Text Input box within your Gallery.

Please check the following GIF screenshot for more details:Test.gif

Please consider take a try with above solution, then check if the issue is solved.

 

Please also check and see if the solution mentioned within the thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Save-Multiple-Records-to-SharePoint-List/m-p/...

 

Best regards,

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.

View solution in original post

2 REPLIES 2
geneZebra
Resolver II
Resolver II

I've done it like this in my app:

 ForAll([1,2,3,4],
          Patch(<table>, Defaults(<table>), // Defaults is needed to create a new blank record 
               {ID: Last(<table>).ID + 1,// or you can use Value to use the index into for loop 
               <other field> : <new value> // put in whatever you want to add
               }

          )

);

Note for excel I needed to manuallt create uniques  ID's.

 

Hope this helps.

Gene

 

 

v-xida-msft
Community Support
Community Support

Hi  ,

Could you please share a bit more about your scenario?

Do you want to add a button to add a new row, then you could submit multiple lines once time?

 

Based on the needs that you mentioned, I think the combination of Gallery control, Patch function and ForAll function could achieve your needs. I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

3.JPG

 

4.JPG

Set the OnStart property of the App to following:

ClearCollect(CurrentIndex, 1)

Add a Gallery control, set the Items proeprty to following:

CurrentIndex

add some Text Input box within this Gallery to collect user's input.

Add a "+" icon button, set the OnSelect property to following:

Collect(CurrentIndex,1)

Add a "Patch" button outside the Gallery, set the OnSelect property to following:

ForAll(
        Gallery1.AllItems, 
        Patch(
              'YourSPList', 
              Defaults('YourSPList'), 
             {
                Column1: TextInput1.Text, 
                Column2: TextInput2.Text,
                Column3: TextInput3.Text,
                ...
             }
       )
)

Note: The TextInput1, TextInput2, TextInput3, ... represents the Text Input box within your Gallery.

Please check the following GIF screenshot for more details:Test.gif

Please consider take a try with above solution, then check if the issue is solved.

 

Please also check and see if the solution mentioned within the thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Save-Multiple-Records-to-SharePoint-List/m-p/...

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,347)