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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,951)