cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abhrai
Level: Powered On

Add Multiple Rows to a Form

I have a form containing around 7 fields which is working correctly when I submit the form after filling in the data. There is an additional requirement to Add multiple Records simultaneaously by clicking on Add Rows button.

Example - Currently user can fill one record information at a time but now what users are asking is to enter multiple records on the form and submit all at once. I was trying to find out this sort of solution but no luck. Anybody has done this sort of implementation . Please let me know. 

 

Thanks,

abhrai

3 ACCEPTED SOLUTIONS

Accepted Solutions
Microsoft Employee

Re: Add Multiple Rows to a Form

Hello @abhrai,

Please note that a Form control can reference only a single record. If you need to allow the user to add the information for an arbitrary number of records and then submit them all at once then you cannot use a form control. You will have to use other controls (a set of 7 TextInput controls and a Gallery control for example) to collect all the information. Please see this link for ways to bulk update/create records: https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch

 

I would suggest to consider the following functionality:

  • Use a form control and submit records one-by one to the database and have a "Confirmed" boolean field that would be set to "false" for each of those record.
  • Have a "Cancel" button which would delete all the records with Confirmed=false
  • Have a "Submit All" button which would update all the just entered records by setting the Confirmed field to "true".

 

SanchezCSG
Level 8

Re: Add Multiple Rows to a Form

Maybe something like this could help you.

 

Insert 3 new forms and a send button. On select if the selected fields have text then send the form.

 

imagenform.JPG

 

The "+" icon onselect is update context true for Visible field in Form2, recicle bin and "+" icons.

 

visible2.JPGvisible2false.JPG

 

The second "+" icon has update context true for the third form and recicle bin icon. And the recicle bin update context false.

 

visible3.JPGvisible3false.JPG

 

Then you have, this. With 1, 2 or 3 forms.

 

1f.JPG2f.JPG3f.JPG

Highlighted
iamlee
Level 8

Re: Add Multiple Rows to a Form

I have solved this by having a Header Form and an Item Form. Because you have 2 forms in a screen, you'll need to use Patch and not SubmitForm. You will also need a column to link the 2 records eventually. It'll be a 1-n relationship and you'll end up with a star data model, which actually works best when you are doing calculations for your data analysis.
4 REPLIES 4
Microsoft Employee

Re: Add Multiple Rows to a Form

Hello @abhrai,

Please note that a Form control can reference only a single record. If you need to allow the user to add the information for an arbitrary number of records and then submit them all at once then you cannot use a form control. You will have to use other controls (a set of 7 TextInput controls and a Gallery control for example) to collect all the information. Please see this link for ways to bulk update/create records: https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch

 

I would suggest to consider the following functionality:

  • Use a form control and submit records one-by one to the database and have a "Confirmed" boolean field that would be set to "false" for each of those record.
  • Have a "Cancel" button which would delete all the records with Confirmed=false
  • Have a "Submit All" button which would update all the just entered records by setting the Confirmed field to "true".

 

Super User
Super User

Re: Add Multiple Rows to a Form

Hi @abhrai,

It sounds like you may want to take another approach to this.  I am thinking that you are looking for the functionality that @Shanescows has described in his video Repeating-Tables-like-you-had-in-InfoPath/m-p/127409#M287.  If I am wrong, then @dinusc may have the solution for you.

SanchezCSG
Level 8

Re: Add Multiple Rows to a Form

Maybe something like this could help you.

 

Insert 3 new forms and a send button. On select if the selected fields have text then send the form.

 

imagenform.JPG

 

The "+" icon onselect is update context true for Visible field in Form2, recicle bin and "+" icons.

 

visible2.JPGvisible2false.JPG

 

The second "+" icon has update context true for the third form and recicle bin icon. And the recicle bin update context false.

 

visible3.JPGvisible3false.JPG

 

Then you have, this. With 1, 2 or 3 forms.

 

1f.JPG2f.JPG3f.JPG

Highlighted
iamlee
Level 8

Re: Add Multiple Rows to a Form

I have solved this by having a Header Form and an Item Form. Because you have 2 forms in a screen, you'll need to use Patch and not SubmitForm. You will also need a column to link the 2 records eventually. It'll be a 1-n relationship and you'll end up with a star data model, which actually works best when you are doing calculations for your data analysis.