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 FileActivity, read the contents to a string variable, the .settings file is in JSON format. - Using the
UiPath.Web.ActivitiesPackage you can access theDeserialize JSONActivity and output the contents to aJObjectvariable - You can access the members of that
JObjectvariable and test it by logging the followingsettingsJObject("UiPathServerUrl").ToStringwheresettingsJObjectwas what I named myJObjectvariable. - 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.