cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CamCov
Helper II
Helper II

On Success for Patch

Hello,

 

I understand the OnSuccess of a form does not work if the Patch() function is used to submit the form. I would like to notify the user if the form is submitted successfully even when using patch. How can I check this and notify with their result? 

 

Here is the patch in my Onsubmit 

CamCov_0-1652283484300.png

(Just looks up title to see if project already exists or not)

 

I would like to navigate(successSceen) when submission is successful or display error message if not without leaving the screen.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@CamCov 

To be a bit more informative, use the Errors() function after the patch:

 

 

Patch('Project Excellence'...);
If(                       // check for errors
   !IsEmpty(
            Errors('Project Excellence'
            )
     ),                   // if true, show any error messages
      Notify(                          
          Concat(
                 Errors(
                        'Project Excellence'
                 ), Column & ": " & Message
           ), NotificationType.Error
     ),
     Notify(
            "Your submission was accepted", NotificationType.Success
     )
)

 

 

View solution in original post

4 REPLIES 4
gabibalaban
Dual Super User
Dual Super User

@CamCov ,

Here is an example it can inspire you:

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

Hope it helps !

Drrickryp
Super User
Super User

@CamCov 

To be a bit more informative, use the Errors() function after the patch:

 

 

Patch('Project Excellence'...);
If(                       // check for errors
   !IsEmpty(
            Errors('Project Excellence'
            )
     ),                   // if true, show any error messages
      Notify(                          
          Concat(
                 Errors(
                        'Project Excellence'
                 ), Column & ": " & Message
           ), NotificationType.Error
     ),
     Notify(
            "Your submission was accepted", NotificationType.Success
     )
)

 

 

CamCov
Helper II
Helper II

@Drrickryp Thank you for the Help! This was exactly what I was looking for!

Hi, 

I have similar problems with displaying the 'success' when a patch and with formula is part of the submit function.

ClarkyPA365_0-1653396954779.png

Where about would I put your example??

Helpful resources

Announcements
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,413)