cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenGillard
Helper III
Helper III

Using Patch to SP list

I am curently using the following to add records to SP which works great.

Patch(PIOT,Defaults(PIOT),Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates)

Whats the best way for me to know it has posted succesfully to SP and get a pop up saying successful?

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @BenGillard,

Do you want to check if the Patch formula executes successfully?

Based on the needs that you mentioned, I think the Errors function could achieve your needs. I have made a test on my side, please check the following workaround:1.JPG

Set the OnSelect property of the "Patch" button to following formula:

If(
IsEmpty(Errors('20190108_MainList', Patch('20190108_MainList', Defaults('20190108_MainList'),{Title: "PowerApps"}))),
Notify("Patch Record Successfully!",NotificationType.Success),
Notify("Patch Record Failed!", NotificationType.Error)
)

On your side, you should type following:

If(
   IsEmpty(Errors(PIOT, Patch(PIOT, Defaults(PIOT), Form2.Updates, Form3.Updates, Form4.Updates, Form5.Updates))), 
   Notify("Patch Record Successfully!", NotificationType.Success), 
   Notify("Patch Record Failed!", NotificationType.Error)
)

Please check the attached GIF screeshot for more details:

 

More details about Errors function, please check the following article:

Errors function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Mike2500
Continued Contributor
Continued Contributor

Good question. Unfortunately, the documention is thin on areas such as error handling. But perhaps try the following:

 

Patch('data source name', ...);If(Not(IsEmpty(Errors('data source name'))),Navigate(ErrorScreen,ScreenTransition.None),Navigate('Success Screen',ScreenTransition.None))

 

Of course, the above is navigating to different screens, replace the navigate with calls to the notify function to get a banner at the top of the current screen.

 

 

 

 

v-xida-msft
Community Support
Community Support

Hi @BenGillard,

Do you want to check if the Patch formula executes successfully?

Based on the needs that you mentioned, I think the Errors function could achieve your needs. I have made a test on my side, please check the following workaround:1.JPG

Set the OnSelect property of the "Patch" button to following formula:

If(
IsEmpty(Errors('20190108_MainList', Patch('20190108_MainList', Defaults('20190108_MainList'),{Title: "PowerApps"}))),
Notify("Patch Record Successfully!",NotificationType.Success),
Notify("Patch Record Failed!", NotificationType.Error)
)

On your side, you should type following:

If(
   IsEmpty(Errors(PIOT, Patch(PIOT, Defaults(PIOT), Form2.Updates, Form3.Updates, Form4.Updates, Form5.Updates))), 
   Notify("Patch Record Successfully!", NotificationType.Success), 
   Notify("Patch Record Failed!", NotificationType.Error)
)

Please check the attached GIF screeshot for more details:

 

More details about Errors function, please check the following article:

Errors function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (3,528)