Hi UiPath forum
I am trying to create a work-flow in a Try/Catch environment. The workflow in itself is working formidably, however the nature of the tasks it automates does unfortunately result in errors.
I really want to make the workflow output a message in a new column, based on whether or not it is a Try or Catch. If no errors were detected, it should output “Processed”, and if errors were detected, it should write “Need Review”. I simply cannot make it work.
Thanks in advance for any help.
The current work-flow is:
Read Range (Excel File)
Add Column to DataTable (Status)
For Each Row → Try(The task it has to do) → Catch(Nothing yet, as I do not know how to write to the specific row in the specific column)
Welcome to our UiPath community.
First add one new column called Status to the input file.
Use For Each Row activity to process one by one item.
Keep the processing of that part in Try block. At the end write status as below.
row("Status") = "Processed"
If any exception occurred while processing the item then it will go to the Catch block. Here update the status as below.
row("Status") = "Needs Review"
At the end of loop, use Write Range activity and pass above DataTable to write back into the excel file.
This is exactly how it is setup right now. Only, I have to add the column “Status” through UiPath Add Data Column, as it needs to be added every single time.
How do I write the status? Like, what activity do I use?
Again, thanks. Sorry if I am a bit clueless.
First use Read Range activity to read the Data from Excel file and it will give output as DataTable. Let’s say dtInput.
And then use Add DataColumn activity to add new column called Status to the DataTable dtInput.
Use Assign activity and pass above expression to update the status for each row.
It worked. Thanks!
Another issue was that I used CurrentRow in my loop, so that when I need to reference the row it was CurrentRow(“Status”) = “Processed”.
Thank you so much!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.