cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CliveMM
Helper I
Helper I

Patch Statement has invalid Arguments

Hi All. This Patch statement fails and it says the patch statement has an invalid argument:-

ForAll(QuestionTemplate, Patch(JobItems, {Q1: QuestionTemplate.Q1}))

 

However this is ok:  ForAll(QuestionTemplate, Patch(JobItems, {Q1: "Hello World"}))       so its I believe then formula is not seeing QuestionTemplate.Q1 as a text input when it is.

 

QuestionTemplate.Q1 and JobItems.Q1 are both columns in a SharePoint list of type 'single line text'

I have also tried ForAll(QuestionTemplate, Patch(JobItems, {Q1: Text(QuestionTemplate.Q1}}))  but that does not work either.

 

Help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @CliveMM ,

Do you want to update JobItems's Q1 field by using the data of Q1 field in QuestionTemplate?

If so, I suggest you use [@] to avoid ambiguity。

Try this formula:

ForAll(QuestionTemplate, Patch(JobItems, {Q1: QuestionTemplate[@Q1]}))

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

ForAll(QuestionTemplate, Patch(JobItems, {Q1: QuestionTemplate.Q1}))
Please note that Q1 should be your columnName in your list and QuestionTemplate should be the name of the textbox on your form or screen. If what I have said is the case then your formula should be:
Patch(JobItems, {Q1: QuestionTemplate.Text}))

Your comments are welcome
If you like this post give thumps up. If it resolved your question then mark as a solution.

Hi Eka24, Thank you for your response, However I am updating without and screen controls, just moving rows from one share point list to the other. I had forgotten the defaults but I have added them now but still  get the same error

 

ForAll(QuestionTemplate, Patch(JobItems,Defaults(JobItems), {Q1: QuestionTemplate.Q1}))

 

v-yutliu-msft
Community Support
Community Support

Hi @CliveMM ,

Do you want to update JobItems's Q1 field by using the data of Q1 field in QuestionTemplate?

If so, I suggest you use [@] to avoid ambiguity。

Try this formula:

ForAll(QuestionTemplate, Patch(JobItems, {Q1: QuestionTemplate[@Q1]}))

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Main issue has to do with the QuestionTemplate.Q1 portion of the formula. Try this
ForAll(QuestionTemplate, Patch(JobItems,Defaults(JobItems), {Q1:Q1}))

Fantastic - Thank you so much

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,475)