cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Patching a Collection Successfully

Hi everyone,

 

currently working on a project that involves patching an entire collection to a sharepoint online list. I am using the following syntax that I've found also on a thread:

 

UpdateContext({msg:"Executing Patch"});
UpdateContext({ patchResult:ForAll(OfflineData,Patch(Timekeeping,Defaults(Timekeeping),{Title:1})) });
If(Not(IsBlank(patchResult)) And IsEmpty(Errors(OfflineData)),UpdateContext({msg:"Patch success"}),UpdateContext({msg:"Patch Failed"});SaveData(OfflineData,"OfflineCache"))

 

What I'm aiming for is to check whether the Patching is successful or not. 

Currently, even if I'm disconnected, it still prompts me that the patch has been successful and opens a popup browser on my phone.

 

Appreciate any kind of help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @zdames,

Could you please share a bit more about the Timekeeping data source? Is it a SP list?

Does the OfflineData represent the Collection that you want to save to your SP list?

Based on the formula that you provided, I think there is something wrong with it. Please modify your formula as below:

UpdateContext({msg:"Executing Patch"});
UpdateContext({patchResult: ForAll(OfflineData,Patch(Timekeeping,Defaults(Timekeeping),{Title:1}))});
If(
!IsEmpty(patchResult) && IsEmpty(Errors(Timekeeping)), /* <-- Modify here. Type your Timekeeping SP List data source within the Errors function rather than the OfflineData */
UpdateContext({msg:"Patch success"}),
UpdateContext({msg:"Patch Failed"});SaveData(OfflineData,"OfflineCache")
)

then check if the issue is solved.

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

Errors function

 

Best regards,

Kris

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

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @zdames,

Could you please share a bit more about the Timekeeping data source? Is it a SP list?

Does the OfflineData represent the Collection that you want to save to your SP list?

Based on the formula that you provided, I think there is something wrong with it. Please modify your formula as below:

UpdateContext({msg:"Executing Patch"});
UpdateContext({patchResult: ForAll(OfflineData,Patch(Timekeeping,Defaults(Timekeeping),{Title:1}))});
If(
!IsEmpty(patchResult) && IsEmpty(Errors(Timekeeping)), /* <-- Modify here. Type your Timekeeping SP List data source within the Errors function rather than the OfflineData */
UpdateContext({msg:"Patch success"}),
UpdateContext({msg:"Patch Failed"});SaveData(OfflineData,"OfflineCache")
)

then check if the issue is solved.

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

Errors function

 

Best regards,

Kris

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,536)