cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dyee4613
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
yashag2255
Dual Super User II
Dual Super User II

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
yashag2255
Dual Super User II
Dual Super User II

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!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,541)