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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,320)