Log Exceptions into Excel

studio

#1

I have 6 workflows, each invoked into the other (For eg. Workflow 1 is invoked into 2, 2 into 3, 3 into 4 and so on). The 7th workflow is the Main workflow into which I have invoked the 6th one. In each workflow, I am using “Create Exception” and “Throw”. The 7th workflow (the main) is put in a Try-Catch block.

I need to catch any exception occuring in any of the 6 workflows and save them in an excel.

How do I do this ?

Please help.


#2

i think that you must use one argument,so you see error the flowchart1,2,3,4,5,6 in flowchart 7


#3

An idea would be to create a string variable to which you assign the value of exception.source or exception.message, whichever you want, then, at the start of any catch block you’ll write it into the excel file.


#4

Hi Susbasu!

I would recommend using a Data Table to collect all your errors. Then, as a final step in your outer-most flowchart, you can write this Data Table to an Excel file. This method has several advantages:

  1. Writing the errors straight to Excel every time you run into one would mean that Excel will constantly be opening/saving/closing in the background of your process every time it encounters an error. If you instead save errors to a Data Table and then write them all to Excel in a single step at the end of your process, Excel will only have to open/save one time.
  2. Each error will be on its own line in Excel, and all you will have to do to add an error entry is use the “Add Data Row” activity to add a row to the bottom of your Data Table. (No need for a row counter or anything like that.)
  3. The “Write Range” activity is specifically designed to transfer an entire Data Table into an Excel document like this, so that will also be a very clean/simple step at the end of your process.

Hope this helps! You can let me know if you need help with Data Tables.

Cheers,
Riley


#5

Thanks a lot, Riley! Works fine now.


#6

Awesome! I’m glad you were able to make that work for you. :slight_smile: