cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
manjotsingh057
Helper IV
Helper IV

PowerApps set field issue

 I want to set a field to yes when submit button is clicked ? I there a way to do this in PowerApps ?

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @manjotsingh057,

 

That depends on where the field for the Yes stored.

If the Yes field is stored within the record submitted by the Submit button, Assuming the Yes field is a text field, then we could take use of the patch () with the following format:

Patch(DataSource, EditForm.LastSubmit, {YesField:"Yes"})

And if you stored the Yes field in other data source other than the one specified with the Submit button, then you need to specify the corresponding data source the records in the patch function.

Patch function in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
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

3 REPLIES 3
Meneghino
Community Champion
Community Champion

Yes, use the Patch() function

Thanks Meneghino,

 

I checked the patch function. Its more like if i want to update a record. But if i want to set field on submit button click on new item form. Can it be used there ? If possible can you please post an example syntax.

v-micsh-msft
Community Support
Community Support

Hi @manjotsingh057,

 

That depends on where the field for the Yes stored.

If the Yes field is stored within the record submitted by the Submit button, Assuming the Yes field is a text field, then we could take use of the patch () with the following format:

Patch(DataSource, EditForm.LastSubmit, {YesField:"Yes"})

And if you stored the Yes field in other data source other than the one specified with the Submit button, then you need to specify the corresponding data source the records in the patch function.

Patch function in PowerApps

 

Regards,

Michael

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

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,594)