cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Add bulk of rows to sharepoint list

Hi,

I'm trying to build a screen for inventory.

I've created a 2 text input labels, 1 is a "Asset Type" and the other one is "Quantity".

I want to be able to add a bulk of "Asset type" rows that depends on the quantity.

 

for example,

If the asset type is "Dell Laptop" and the quantity the user choose is 10, after i click on the add button it will add 10 rows of Dell laptop to the sharepoint list.

 

will appreciate your help!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Add bulk of rows to sharepoint list

Hi @PowerU ,

Do you want to add multiple rows back to your SP List once time based on the entered "Quantity" number?

 

Based on the needs that you mentioned, I think the combination of ForAll function and Patch function could achieve your needs. Please take a try with the following formula:

ForAll(
       FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], Value(QuantityTextBox.Text)),
       Patch(
             'Your SP List',
             Defaults('Your SP List'),
             {
               Title: "xxxxx",
               AssetType: AssetTypeTextBox.Text
             }
       )
)

Note: In above formula, I assume that the Quantity value you entered is not more than 20. If the Quantity value you want to enter is more than 20, please modify the [1,2,3,4,5, ....., 20] array table into proper array. e.g.

[1,2,3,4,5,6,7,8,9,10,11,12, ....., 50,51,52,53, ...., 99,100]

 

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

 

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
Highlighted
Microsoft
Microsoft

Re: Add bulk of rows to sharepoint list

@PowerU 

 

You can initialize a collection on the on start of the application which will store index values as records,

Ex: ClearCollect(indexes,{Index:1},{Index:2) ……. {Index:100})

 

Once you have this setup you can use for all function as ForAll(Filter(indexes,index<10),operation to perform)

 

This works same as like for(I=0,i<10)

 

If this information helps you with resolution, please consider giving a thumbs up and mark the solution as resolved.

Highlighted
Community Support
Community Support

Re: Add bulk of rows to sharepoint list

Hi @PowerU ,

Do you want to add multiple rows back to your SP List once time based on the entered "Quantity" number?

 

Based on the needs that you mentioned, I think the combination of ForAll function and Patch function could achieve your needs. Please take a try with the following formula:

ForAll(
       FirstN([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], Value(QuantityTextBox.Text)),
       Patch(
             'Your SP List',
             Defaults('Your SP List'),
             {
               Title: "xxxxx",
               AssetType: AssetTypeTextBox.Text
             }
       )
)

Note: In above formula, I assume that the Quantity value you entered is not more than 20. If the Quantity value you want to enter is more than 20, please modify the [1,2,3,4,5, ....., 20] array table into proper array. e.g.

[1,2,3,4,5,6,7,8,9,10,11,12, ....., 50,51,52,53, ...., 99,100]

 

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

 

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
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!

Top Solution Authors
Top Kudoed Authors
Users online (6,933)