Flow Designer Tru Catch

etienne3
Tera Contributor

Hi all,

 

I am creating custom flows and am using the Try flow logic - just as a developer would do with a try catch. Now, I would like to capture the message the Try throws up (ex.message in normal scripting).

 

It seems that the Flow logic Try step does not have any pills available to use.

 

Is there any way the message can be captured/accessed? Viewing the flow execution there is an error status, with codes and message. But it seems you cannot capture that through a pill.

10 REPLIES 10

etienne3
Tera Contributor

Yes, but would be sort of generic. If I have multiple look ups and inserts/update, the idea is to have more then 1 try catch so that we can pinpoint the exact error and at which point it occurred without the need of going into the execution details of the flow.

Hi @etienne3 ,I attempted something, but I'm not sure how well it fits your requirements.

Try using the try-catch itself but limit the 'try' block to just one step. In the 'catch' block, you can reference the 'Action Status -> Message' of the step inside the 'try' block, like this—(see the images).

SC1.pngSC2.pngSC3.pngSC4.png

Yes, that makes sense. But it would be, as you said, capturing one particular step. If I have multiple updates...! What could be done is a loop to capture the messages form the steps - but I do not think that is accessible.

Ankur Bawiskar
Tera Patron
Tera Patron

@etienne3 

you can use Error handler in flow and get the error details

Try flow logic 

Using Error Handler 

Flows Best Practices Error Handling - Workflow Automation CoE 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

The question was around Flow Logic!
Using error handler is a bit generic. If I have multiple updates/inserts, look ups, loops, etc, I would like to have try catch at strategic points and grab the message of the error there, not the the message from the error handler. The error handler is good if you have a "simple" flow, but for more complex flows it is restrictive.