I know you can view the logs and export them from Orchestrator as CSV after completing an automation…is there a way that I can have the robot do this automatically and send as an email prior to completing in the workflow?
sure, you just insert logs to an excel/csv file during robot execution using the excel scope or other csv activities, then put a send outlook mail activity before the last activity of your flowchart (with attaching the log csv file)
Thanks Shan, I just wanted to confirm there is no other way vs doing it manually by appending logs to .csv or .xlsx file. It’s nice because after execution you can export a clean .csv file with the Time, Level, Process, User and Message columns all formatted, so I wasn’t sure if I could automate the effort of simply exporting the file vs creating it manually while the robot runs.
Have you tried using an “Orchestrator HTTP Request” to download the csv straight from Orchestrator at the end of your process?
https://<server>/odata/RobotLogs/UiPath.Server.Configuration.OData.Reports?$filter=(JobKey eq <job key>)
Thanks @qbrandon! I didn’t think to try this, I will give this a shot today and see if that gives me what I need. Appreciate your input.
This is definitely on the right track, question is how can I build into the workflow to get the jobID to feed the request? I was able to do it manually through view the logs in Orchestrator but ideally I would want to have the robot do it all.
How to determine the jobId depends a lot on your use case, but you can start by running GetJobs and filtering by:
I could really use this solution for my automated processes but I have no idea on how to use the “HTTP Request” activity, could you please post an example so I can use? Thank you!
Main.xaml (6.0 KB)
Tested with 2018.1.3.
Note that on Orchestrator, I had to create a Role with only Log View privileges, and added that role the relevant robot user (by default, robot users do not have permission to access Logs)
Thank you for your quick response!
Unfortunately when I open your xaml I got the following error:
Can it be because I do not have the proper package installed? The Activity you use is “HTTP Request” right?
This activity requires at least 2018.1
Can you share what version you are using?
When I try to use the Get Jobs activity I am unable to create a variable for the output…I get a blue exclamation error saying Type “OrchestratorJobs” does not exist. Any ideas on that?
Hi qbrandon, sorry for my late response.
I’m using Studio version 2017.1.6522
Can this be achieved with the activity “HTTP Request”?
This is less convenient, but yes, this can be achieved with the HTTP Request activity.
You will need to:
- login (get a session token in exchange of a username/password)
- request the Report using the URL mentioned here-above.
The process is described here (Authentication):
The 2018.1 Orchestrator HTTP Request is more convenient because it automatically uses the robot credentials rather than have you manually handling user credentials.
Again, make sure that whatever user is used for auth, it needs to have the appropriate Orchestrator permissions.