cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

ForAll Patch Function Error

I have this formula in a working version of this app.  I created a new version of the app, for testing purposes, and modified a few columns.  I updated the formula and now it stopped working.  The error doesn't give me any hints.  It just says the patch function has some invalid arguments.  I double checked my collection (SubmitData) and the fields match up exactly.  I'm perplexed. 

ForAll(SubmitData,Patch(h2a2,Defaults(SubmitData),
{
ID:ID,
Counter:Counter,
ddate: ddate,
User: User,
Location: Location,
RM: RM,
MaxOccupants: MaxOccupants,
Comment: Comment,
CommentType: CommentType,
CloseDate: CloseDate,
Status: Status,
Q1:Q1,
Q2:Q2,
Q3:Q3,
Q4:Q4,
Q5:Q5,
Q6:Q6,
Q7:Q7,
Q8:Q8,
Q9:Q9,
Q10:Q10,
Q11:Q11,
Q12:Q12,
Q13:Q13,
Q14:Q14,
Q15:Q15,
Q16:Q16,
Q17:Q17,
Q18:Q18,
Q19:Q19,
Q20:Q20,
Q21:Q21,
Q22:Q22,
Q23:Q23,
Q24:Q24,
Q25:Q25,
Q26:Q26,
Q27:Q27,
Q28:Q28,
Q29:Q29,
Q30:Q30,
Q31:Q31,
Q32:Q32,
Q33:Q33,
Q34:Q34,
Q35:Q35,
Q36:Q36,
Q37:Q37,
Q38:Q38,
Q39:Q39,
Q40:Q40,
Q41:Q41,
Q42:Q42,
Q43:Q43,
Q44:Q44,
Q45:Q45,
Q46:Q46,
Q47:Q47,
Q48:Q48,
Q49:Q49,
Q50:Q50,
Q51:Q51,
Q52:Q52,
Q53:Q53,
Q54:Q54,
Q55:Q55,
Q56:Q56,
Q57:Q57,
Q58:Q58,
Q59:Q59,
Q60:Q60,
Q61:Q61,
Q62:Q62,
Q63:Q63,
Q64:Q64,
Q65:Q65,
Q66:Q66,
Q67:Q67,
Q68:Q68,
Q69:Q69,
Q70:Q70,
Q71:Q71,
Q72:Q72
}));

And right as I post it the error message magically disappears.  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Hi @dyee4613 , 

 

I think the error you are getting is because you are using your collection inside the Patch function's Defaults(), instead of using the Data Source. 
Defaults is used to create a new record in the data source and it must have the same value as the data source that you are trying to patch.
 
Please make the modification:
ForAll(SubmitData,Patch(h2a2,Defaults(h2a2),
{
ID:ID,
Counter:Counter,
ddate: ddate,
User: User,
Location: Location,
RM: RM,
MaxOccupants: MaxOccupants,
Comment: Comment,
CommentType: CommentType,
CloseDate: CloseDate,
Status: Status,
Q1:Q1,
Q2:Q2,
Q3:Q3,
Q4:Q4,
Q5:Q5,
Q6:Q6,
Q7:Q7,
Q8:Q8,
Q9:Q9,
Q10:Q10,
Q11:Q11,
Q12:Q12,
Q13:Q13,
Q14:Q14,
Q15:Q15,
Q16:Q16,
Q17:Q17,
Q18:Q18,
Q19:Q19,
Q20:Q20,
Q21:Q21,
Q22:Q22,
Q23:Q23,
Q24:Q24,
Q25:Q25,
Q26:Q26,
Q27:Q27,
Q28:Q28,
Q29:Q29,
Q30:Q30,
Q31:Q31,
Q32:Q32,
Q33:Q33,
Q34:Q34,
Q35:Q35,
Q36:Q36,
Q37:Q37,
Q38:Q38,
Q39:Q39,
Q40:Q40,
Q41:Q41,
Q42:Q42,
Q43:Q43,
Q44:Q44,
Q45:Q45,
Q46:Q46,
Q47:Q47,
Q48:Q48,
Q49:Q49,
Q50:Q50,
Q51:Q51,
Q52:Q52,
Q53:Q53,
Q54:Q54,
Q55:Q55,
Q56:Q56,
Q57:Q57,
Q58:Q58,
Q59:Q59,
Q60:Q60,
Q61:Q61,
Q62:Q62,
Q63:Q63,
Q64:Q64,
Q65:Q65,
Q66:Q66,
Q67:Q67,
Q68:Q68,
Q69:Q69,
Q70:Q70,
Q71:Q71,
Q72:Q72
}));
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

1 REPLY 1
Highlighted
Dual Super User III
Dual Super User III

Hi @dyee4613 , 

 

I think the error you are getting is because you are using your collection inside the Patch function's Defaults(), instead of using the Data Source. 
Defaults is used to create a new record in the data source and it must have the same value as the data source that you are trying to patch.
 
Please make the modification:
ForAll(SubmitData,Patch(h2a2,Defaults(h2a2),
{
ID:ID,
Counter:Counter,
ddate: ddate,
User: User,
Location: Location,
RM: RM,
MaxOccupants: MaxOccupants,
Comment: Comment,
CommentType: CommentType,
CloseDate: CloseDate,
Status: Status,
Q1:Q1,
Q2:Q2,
Q3:Q3,
Q4:Q4,
Q5:Q5,
Q6:Q6,
Q7:Q7,
Q8:Q8,
Q9:Q9,
Q10:Q10,
Q11:Q11,
Q12:Q12,
Q13:Q13,
Q14:Q14,
Q15:Q15,
Q16:Q16,
Q17:Q17,
Q18:Q18,
Q19:Q19,
Q20:Q20,
Q21:Q21,
Q22:Q22,
Q23:Q23,
Q24:Q24,
Q25:Q25,
Q26:Q26,
Q27:Q27,
Q28:Q28,
Q29:Q29,
Q30:Q30,
Q31:Q31,
Q32:Q32,
Q33:Q33,
Q34:Q34,
Q35:Q35,
Q36:Q36,
Q37:Q37,
Q38:Q38,
Q39:Q39,
Q40:Q40,
Q41:Q41,
Q42:Q42,
Q43:Q43,
Q44:Q44,
Q45:Q45,
Q46:Q46,
Q47:Q47,
Q48:Q48,
Q49:Q49,
Q50:Q50,
Q51:Q51,
Q52:Q52,
Q53:Q53,
Q54:Q54,
Q55:Q55,
Q56:Q56,
Q57:Q57,
Q58:Q58,
Q59:Q59,
Q60:Q60,
Q61:Q61,
Q62:Q62,
Q63:Q63,
Q64:Q64,
Q65:Q65,
Q66:Q66,
Q67:Q67,
Q68:Q68,
Q69:Q69,
Q70:Q70,
Q71:Q71,
Q72:Q72
}));
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,149)