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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,901)