cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Smatera9681
Level: Powered On

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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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.
Smatera9681
Level: Powered On

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

Smatera9681
Level: Powered On

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

 

Smatera9681
Level: Powered On

Re: Trying to create submit button to update another field

Here is a screenshot to helppowerapps.jpg

Community Support Team
Community Support Team

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,650)