I want to log the name of the orchestrator withing script.
Yes, it’s a bit of a strange process but it can be done. Hopefully in future updates this could be added to the Environment properties… But for now you can do as follows:
First you will need to know the location of the
UiPath.settings file. This should be under the directory where UiPath is installed. This path is different for Community and Enterprise Studio!
Once you’ve located that, you just need 3 simple steps within a workflow…
- Using the
Read Text FileActivity, read the contents to a string variable, the .settings file is in JSON format.
- Using the
UiPath.Web.ActivitiesPackage you can access the
Deserialize JSONActivity and output the contents to a
- You can access the members of that
JObjectvariable and test it by logging the following
settingsJObjectwas what I named my
- From here you have access to the information you need, additionally you can assign the value of the
UiPathServerUrlElement to a string variable for isolated use further along in your workflow preventing access to the remaining settings in the other portions of your workflow.
Other information is available by default such as Machine Name that the Studio is connected to via
Environment.MachineName. To get the Robot ID you will need to setup an HTTP Get Request to Orchestrator as far as I’m aware.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.