cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmitLoh-Powerap
Kudo Kingpin
Kudo Kingpin

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
Community Champion
Community Champion

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

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
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 (7,193)