Yes! This is possible - it is a hidden/undocumented SAIL function. Try-catch in Appian SAIL: try ( [CODE], "Code failed" )
EDIT: Thank you, Josh, for that insight! Please exercise care when using this function.
I do not recommend using undocumented functionality. Appian does not guarantee that undocumented functions will continue to work when you upgrade from one version to the next.
How do you get to know about undocumented functions.
You don't and shouldn't go looking for things that are not officially supported as it may suddenly stop working.
All you can do is make your SOAP/REST call in a rule that accepts a failure and somehow manipulates it into code that Appian doesn't consider to ever "Error".
Since try() is undocumented, Appian officially does not have any form of error handling at all. You have to make code that never errors, even if the thing it calls errors.
People are serious about not using the undocumented functions. Case in point, I swear at one point there was an undocumented catch() function, but I can't find it now. I never did figure out what it did.
Interesting side note: wherecontains() was undocumented for a while before being officially added.
I heard from some engineers at Appian World that they think about documenting try(), from time to time. But then they think about what could happen in the global Appian ecosystem if they did that, and they decide not to. Maybe it's because they'd have to provide support untangling the mess some of us could get into misusing try().
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.