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!
Community: C:\Users\<USERNAME>\AppData\Local\UiPath\UiPath.settings
Enterprise: C:\Program Files(x86)\UiPath\Studio\UiPath.settings
Once you’ve located that, you just need 3 simple steps within a workflow…
- Using the
Read Text File
Activity, read the contents to a string variable, the .settings file is in JSON format. - Using the
UiPath.Web.Activities
Package you can access theDeserialize JSON
Activity and output the contents to aJObject
variable - You can access the members of that
JObject
variable and test it by logging the followingsettingsJObject("UiPathServerUrl").ToString
wheresettingsJObject
was what I named myJObject
variable. - From here you have access to the information you need, additionally you can assign the value of the
UiPathServerUrl
Element 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.