cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Trying to create submit button to update another field

I am new to power apps and still learning

 

Basically what I am trying to do is Add the basic submit button and when the user clicks that button in the app it updates my Attending Field to YES and submits the item to my list.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Trying to create submit button to update another field

Hi @Smatera9681,

Do you mean that the 'Attendee List' is a SP list on your side?

Could you please share more details about your error message?

If the Attending field is a Yes/No type column in your SP list, I think there is something wrong with the formula that you provided.

Please take a try to modify your formula as below (Add the following formula within the OnSuccess property of the Edit form control😞

Patch(
'Attendee List',
Form1.LastSubmit,
{
Attending: true /* <- Change YES into true */
}
)

Or

Patch(
'Attendee List',
LookUp('Attende List', ID = Form1.LastSubmit.ID),
{
Attending: true /* <- Change YES into true */
}
)

when you submit your form data using SubmitForm function (via clicking the "Submit" button), above formula would be executed.

 

Best regards,

Kris

Community Support Team _ Kris Dai
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
Highlighted
Community Support
Community Support

Re: Trying to create submit button to update another field

Hi @Smatera9681,

Could you please share a bit more about your scenario?

How do you summit your data into your SP list? Using SubmitForm function?

Do you want to update the Attending field of the submitted item to YES within your SP list?

I assume that you use SubmitForm function to submit your form data into your SP list, and want to update the Attending field of the submitted item to YES, is it true?

If you want to update the Attending field of the submitted item to YES, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Add a button control within your app, set the OnSelect property to following:

SubmitForm(EditForm1) /*<- EditForm1 represents the Edit form control within your app */

Set the OnSuccess property of the Edit form (Editform1) to following:

Patch(
    'YourSPList',
     EditForm1.LastSubmit,
     {
       Attending: YES
     }
)

Or

Patch(
    'YourSPList',
     LookUp('YourSPList', ID = EditForm1.LastSubmit.ID),
     {
       Attending: YES
     }
)

More details about the Patch function, please check the following article:

Patch function

 

In addition, if you want to update an existing record in your SP list using Patch function, please take a try with the following formula:

Patch(
    'YourSPList',
     LookUp('YourSPList', ID = "The specific List Item ID"), /* <-- Find the speific item you want to update based on Primary/Identity column */
     {
       Column1: "xxx",
       Column2: "xxx",
       Column3: "xxx",
       ...
     }
)

 

Best regards,

Kris

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

Re: Trying to create submit button to update another field

Hi Kris

 

Thanks for the Reply.  Basically here is my scenario

 

1. We have an attendee list for a lunch and learn, users will get an email about the lunch and learn and click on the link to the Powerapps form

2. The form will appear and they click on the button which says they will attend.

3. Once they click the button this will put a recod in the attendee list stating they will attend

4. I have a field call attending which is a yes or no field when they accept the lunch and learn I would like the submit button to write the record to the list as well as change the Attending field to Yes for that record.

 That is pretty much it in a nutshell

 

Please let me know if you have any other questions as I hope this answers things for you

 

Thanks

Highlighted
Frequent Visitor

Re: Trying to create submit button to update another field

ALso just to add my list is Called Attendee List, I am running into issues when using patch commands here is what i have

Patch('Attendee List',Form1.LastSubmit,{Attending: YES})

The above syntax tells me i Have three errors that state the following

1. Name isnt valid. This identifier isnt recognized. This error appears most commonly when a formula refers to something that no longer exists

2. Same error as number 1

3. The Function patch has some invalid arguments

 

Let me know if you need more info

 

Thanks

 

Highlighted
Frequent Visitor

Re: Trying to create submit button to update another field

Here is a screenshot to helppowerapps.jpg

Highlighted
Community Support
Community Support

Re: Trying to create submit button to update another field

Hi @Smatera9681,

Do you mean that the 'Attendee List' is a SP list on your side?

Could you please share more details about your error message?

If the Attending field is a Yes/No type column in your SP list, I think there is something wrong with the formula that you provided.

Please take a try to modify your formula as below (Add the following formula within the OnSuccess property of the Edit form control😞

Patch(
'Attendee List',
Form1.LastSubmit,
{
Attending: true /* <- Change YES into true */
}
)

Or

Patch(
'Attendee List',
LookUp('Attende List', ID = Form1.LastSubmit.ID),
{
Attending: true /* <- Change YES into true */
}
)

when you submit your form data using SubmitForm function (via clicking the "Submit" button), above formula would be executed.

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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