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
Dual Super User

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

 

 

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,195)