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

Performing a save and also update a field value

Hello,

 

I am trying to incorporate a "Save & Submit" button. When this button is clicked, I would like to update a text field to "Yes" and also save the rest of the data on the form.

 

I currently have this

 

Patch('MyRequests', {ID: Value(ID_DataCard1.Default)},{'Start WF?':"Yes"}); SubmitForm(SharePointForm1);

 

However, this only saves the record without setting the value of the text field to Yes. I had to press the button again to update the text field.

 

Can this be achieved using Power Apps?  Please help

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cooltechie 

 

Keep it

 

perform your ptach before these

 

 

View solution in original post

11 REPLIES 11
RezaDorrani
Dual Super User II
Dual Super User II

Hi @cooltechie 

 

Let it only submit form 

 

then on the OnSuccess property of the form

 do

 

Patch('MyRequests', formname.LastSubmit, {'Start WF?':"Yes"});

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi Reza,

 

Thank you for your response. Currently the On Success form event has

 

ResetForm(SharePointForm1); RequestHide()

 

Should I keep this or remove?

Hi @cooltechie 

 

Keep it

 

perform your ptach before these

 

 

View solution in original post

Tried and unfortunately it didn't work. It submits the form but doesn't update the field,

@cooltechie 

 

Share screenshot of OnSuccess property of the form

I take that back. I cleared cache and it seems to be working. Thank you.  Now how do I  make the button disabled after I submit?

Hi @cooltechie 

 

after your submit

the onscuccess property will patch then reset form and then request hide (which should close the form window)

so not sure why you need to disable the button

That is a requirement. The reason is that if the user views the form the disabled button will tell him that it was submitted,

Hi @cooltechie 

 

Is this a submit button that you created or is the the default submit button that shows up on the form screen menu?

 

I need to understand the scenario when you want to disable

A screenshot would help

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,151)