cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zdames
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
v-xida-msft
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
v-xida-msft
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
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 Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (73,777)