cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhollan
Post Patron
Post Patron

Show success message after patch

I have a form that uses the patch function on submit.  How do I show a 'Your request has been submitted!' message after the patch function has executed when a new form is submitted?

1 ACCEPTED SOLUTION

Accepted Solutions

@ahhollan 
Right!  I didn't read carefully enough.  Here's the code for PATCH.

Set(varRecord, Patch(your_code_here));
If(!IsBlank(varRecord),
    Notify("Your request has been submitted!", Notification.Success),
    Notify("Your request was not submitted", Notification.Failure)
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

8 REPLIES 8
ZabiBabar
Continued Contributor
Continued Contributor

If you are using a form control, the form has a onSubmit property that you can use to navigate to a new screen or to show a pop up or a modal with the success message. 

 

However, If you are using a patch function instead of Submit(Form) formula then you can check if there were any errors from the patch(). If there weren't any errors you can navigate to a new screen or show a pop up or a modal with the success message. 

 

Patch(DataSource, Record); If(IsEmpty(Errors(IceCream, EditRecord)), <Show Success Message>, <Show failure message>)

 

You can find a similar scenario as yours on the page

Pstork1
Dual Super User
Dual Super User

Take a look at this article on how to display a dialog using Power Apps.  

https://powerapps.microsoft.com/en-us/blog/creating-dialogs-in-powerapps/

Follow those steps and use an UpdateContext() after the Patch() in your onselect to display the dialog.  Have a button or 'X' on the dialog to dismiss it and updateContext() to false to make the dialog disappear again.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
mdevaney
Super User
Super User

@ahhollan 
Put this code in the OnSuccess property of your Form

Notify("Your request has been submitted!", Notification.Success)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

This formula doesn't work since I'm using the patch function and not SubmitForm.  I'm seeing a lot about using updatecontext, but I haven't fully figured that out yet.

ZabiBabar
Continued Contributor
Continued Contributor

@ahhollan I used this video to do a similar functionality of one of my projects. https://www.youtube.com/watch?v=SaDEVOgOlYY&list=PLcwrIWK7WBcRyFBAFeC-Ws8kJYAGTc8Qi&index=16

@ahhollan 
Right!  I didn't read carefully enough.  Here's the code for PATCH.

Set(varRecord, Patch(your_code_here));
If(!IsBlank(varRecord),
    Notify("Your request has been submitted!", Notification.Success),
    Notify("Your request was not submitted", Notification.Failure)
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I had to change Notification to NotificationType, but once I did that it worked. Thanks for all the help. You are always helpful and quick to respond.

abbyltorres
Regular Visitor

There's also a "Success Message" field on the Entity Form where you can simply add the desired message. 

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 (2,131)