Hi guys, I'm currently working on a project where I have to make multiple patches to multiple SharePoint Lists. Now what I want to do is, if any one of the Patch() fails then the other patches should also fail. I tried to implement this using IsError() like this,
Scenario 1: pass the ID of the first patch to the second patch
If(
IsError(
Set(
patchVal,
Patch(list1,Defaults(list1),{col:val})//Patch ends
)//Set ends
)//is error ends
,//condition ends
Notify("Error while patching")
,
Patch(list2, {col:patchVal.ID})
)
Scenario 2: the patches are unrelated
If(
IsError(
Patch(list1,Defaults(list1),{col:val})//Patch ends
)//is error ends
,//condition ends
Notify("Error while patching"),
Patch(list2, {col:val})
)
Now the problem with this approach is that, sometimes the first patch works correctly and I get an error on the second Patch() only. Is there any way to cancel the first patch also if the second one fails. Thanks in advance.
Condition: If any one Patch fails then all the other patches should also fail.
@mdevaney @elseb @FLMike @WarrenBelz