cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TML
Advocate II
Advocate II

Using ForAll(collection) with Patch - what am I doing wrong?

I have successfully created a collection.  When the user clicks a button, I have the below code in the OnSelect section.  It tells me that The function 'Patch' has some invalid arguments.  If I remove the ForAll piece and use a label.Text instead of collection!field (I also tried collection.field), then the Patch function doesn't complain and a record is created.  But if I use ForAll and try to create multiple records, I cannot get it to work.  What am I doing wong?

ForAll(cResponses, Patch(
	'[dbo].[Items]', 
	Defaults('[dbo].[Items]'), 
	{Survey_Key: Value(lblNewSurveyKey.Text)}, 
	{SurveyResponse_Key: cResponses.Response_Key}, 
	{Survey_Status: rbStatus.Selected.Value}, 
	{Survey_Comments: txtTraining.Text}, 
	{Survey_CreatedBy: lblUserName_1.Text}, 
	{Survey_CreatedOn: Now()}, 
	{Survey_ModifiedBy: lblUserName_1.Text}, 
	{Survey_ModifiedOn: Now()}))
	

Any and all help is appreciated.

 

11 REPLIES 11

ThisRecord makes sense. Thank you for the input.

R4isin
Advocate I
Advocate I

Hello here,

 

I know that is a old post (2017) and that your solution works fine but I found this topic which explains how to omptimize a mulitple patch.

Can be usefull if someone searches :

PATCH Multiple Records In Power Apps 10x Faster - Matthew Devaney

 

kr,


R4isin

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,110)