cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

How to bulk update 50 rows one screen with editable grid like control

many times user wants to edit many rows in excel like grid and save at one go. How to do that easily in powerapps(not in excel addin)?

2 REPLIES 2
mr-dang
Level 10

Re: How to bulk update 50 rows one screen with editable grid like control

Hi, 

This can be done using the ForAll function. You need to communicate to PowerApps:

  1. Which records you want to edit
  2. How you want it edited

 

ForAll(datasource_temp,
	Patch(datasource,First(Filter(datasource,PrimaryId=PrimaryId)),
		{field1: [change],
			field5: [change]
		}
	)
)

In the formula above, it assumes you have collected all the records that need a change into a temporary collection. 

 

The formula means "for every record in the temporary collection, edit the corresponding record in the original datasource whose ID equals that one, and only change fields 1 and 5."

 

You may need to use disambiguation if the field name in the temp collection is the same as the original datasource.

Microsoft Employee
@8bitclassroom

Re: How to bulk update 50 rows one screen with editable grid like control

Hello,

 

I am writing this as i cannot see any solution for this in the forum. I am trying to bulk update 5 rows each contains 7 columns with different values using ForAll and patch functions. However, it is getting updated with same value for all 5 rows.

 

My formula for Submit button:

ForAll(Timesheet,(Patch(TimeSheet_Week1,{Day: Value(TextBox8.Text),Worked: Value(TextInput1.Text),Vacation: Value(TextInput2.Text),Sick:Value(TextInput3.Text),Overtime: Value(TextInput4.Text),Client: TextInput5.Text,Location: TextInput6.Text},{Day: Value(TextBox10.Text),Worked:Value (TextInput7.Text),Vacation: Value(TextInput8.Text), Sick:Value(TextInput9.Text), Overtime:Value(TextInput10.Text), Client:TextInput11.Text, Location:TextInput12.Text},{Day: Value(TextBox16.Text),Worked:Value (TextInput13.Text),Vacation: Value(TextInput14.Text), Sick:Value(TextInput15.Text), Overtime:Value(TextInput16.Text), Client:TextInput17.Text, Location:TextInput18.Text},{Day: Value(TextBox17.Text),Worked:Value (TextInput19.Text),Vacation: Value(TextInput23.Text), Sick:Value(TextInput24.Text), Overtime:Value(TextInput25.Text), Client:TextInput21.Text, Location:TextInput22.Text},{Day: Value(TextBox18.Text),Worked:Value (TextInput31.Text),Vacation: Value(TextInput30.Text), Sick:Value(TextInput29.Text), Overtime:Value(TextInput28.Text), Client:TextInput26.Text, Location:TextInput27.Text}))

 

UI of the app:

Patch_ForAll.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Can someone help me on this formula part.

 

Regards,

 

Naga

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,012)