cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MelindaK
Level 8

Create many SharePoint list items

Hi all,

 

I was wondering is there a way of creating multiple SharePoint list items with a form? Something like repeating sections in InfoPath? I have a requirement where users want to add multiple itemsin the list by filling in one single form.

 

Thank you,

MelindaK

 

MelindaK
1 ACCEPTED SOLUTION

Accepted Solutions
Steelman70
Level 10

Re: Create many SharePoint list items

Hello, yes there is.  As far as I know you cannot use edit forms (which are limited to one record), but should instead leverage the gallery.  Then you use the Patch function (possibly in combination with the ForAll function) to write the data back in a batch to the SharePoint list or any other source.

 

Exactly how you do it depends on the scenario.  If you describe it a bit, I can be more specific with advice.

View solution in original post

9 REPLIES 9
Steelman70
Level 10

Re: Create many SharePoint list items

Hello, yes there is.  As far as I know you cannot use edit forms (which are limited to one record), but should instead leverage the gallery.  Then you use the Patch function (possibly in combination with the ForAll function) to write the data back in a batch to the SharePoint list or any other source.

 

Exactly how you do it depends on the scenario.  If you describe it a bit, I can be more specific with advice.

View solution in original post

MelindaK
Level 8

Re: Create many SharePoint list items

Thanks for the reply Steelman70 🙂  good to hear there might be a way of doing this.

 

In my case the form by default would look like a single item form, but it should be able to replicate itself once the user has clicked the + button. Something like an ordering form where you want to order banana, apple and cheese at once, but for each of them you want to specify the quantity and only at the end to submit the order.

 

Hoep this makes sense 🙂 

MelindaK
Meneghino
Level 10

Re: Create many SharePoint list items

Makes sense (this is Steelman but I have changed email address and alias)

 

If that is the scenario, I would suggest two alternative ways of doing it:

 

1) A gallery of items with a text input control for each item. The number that the user enters into the text input is the order quantity for that particular item. Then there is a button outside the gallery "Submit order" that when pressed send the order at once with this sort of pseudo code:
ForAll( GalleryItems, If ( Value(TextInpt.Text)>0, Patch (MySharePointList, MyRecord, {Order quantity: Value(TextInput.Text)})))

 

2) An order form, with a button for "Add to cart".  The button, when pressed, adds the order to a local collection "ShoppingCart" via a Collect statement.  Then you need a gallery that displays the contents of ShoppingCart, with a button "Submit order" that has a similar pseudo code as in 1 above except that it starts with ForAll ( ShoppingCart etc. etc.

 

 

Please let me know if anything is unclear or if you need more details on how to proceed.

MelindaK
Level 8

Re: Create many SharePoint list items

Thanks for the help 🙂 I have tried both methods, but I have decided to use the second one.
Even though I have encountered a problem here in collecting the data from the form into a Collection.

This is the formula I am using when the button is pressed:
Collect(Orders, {Title: UnitNameValue.Text, Cost: Value(CostValue.Text)})
- where Title should be text and Cost number.

 

Once the button is pressed the columns are being created in the collection but the values are Title: empty, Cost: 0. It doesn't seem to be taking them from the form. I'm not sure what I am doing wrong here Smiley Frustrated

 

MelindaK
Meneghino
Level 10

Re: Create many SharePoint list items

Hi, are you using an actual form (i.e. edit form) or are UnitNameValue and CostValue the names of two text inputs in your screen?

 

Also, try this.  In the screen where your order form is (I am using the term form loosely, I do not mean an actual PowerApps form), place a new text box and set its text property to UnitNameValue.Text

What does this show when you input text into the UnitNameValue control?  It should reflect your input as soon as it is changed.

MelindaK
Level 8

Re: Create many SharePoint list items

Hi, I am using an actual Edit Form. I have now added a text input on the page and I have successfully collected the value from it.

If I put a text box with the text value of UnitNameValue.Text it is empty.

 

Does it have to do with the form context?

MelindaK
Meneghino
Level 10

Re: Create many SharePoint list items

I do not use edit forms as I find them too fiddly, I normally just create my own text input controls or other controls as needed (i.e. dropdown etc.) so I can place them on the screen freely.  So I have no experience with formal PowerApps forms.

If you have had success with a text input and if you want to proceed in this direction then I can certainly help.

MelindaK
Level 8

Re: Create many SharePoint list items

yeah it makes sense I will continue using the text inputs as you said the final layout of the form will need to be different than the standart PowerApps forms.

 

Thanks for all the help 🙂 

MelindaK
Jfaulkner
Level: Power Up

Re: Create many SharePoint list items

Can someone provide screen shots? I'm a beginner

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,532)