Porject name from RPA

Hi, is it possible to get the Project name from the running Bot. I need this in a Excel File if this Bot run.

It’s a tricky proposition that is different while you are working in Studio vs when the project is deployed.

For example in Studio, you can simply read the project.json file and then extract the project name from that. But that may or may not work when the package is actually deployed and run from Assistant.
You can give it a shot because project.json is in the same folder as the main.xaml and therefore it may work even after the project is deployed. A simple deployment test will help you answer that.

If that fails, there might be another way:

When deployed the package is deposited to this path on your machine

C:\Users\YourUserName\.nuget\packages\ProjectName\many\other\folders\and\files

You can try to resolve the path to the current folder path using File or folder operations in your Main.xaml

When the full path to the folder is returned, the project name is the first one after \packages in the file path.

I hope this helps.

Hi @AndyMenon,

thanks for your Idea. I create a solution with the Deserialize JSON Activities.

grafik

2 Likes

Sweet @raiko.m :slight_smile:

If you deploy this to the Orchestrator and then run it from Assistant, does it still work?

Please let us know because that would be interesting!

And, welcome to the community!

Yes it works on the Orchestrator as well, i only add the Package UiPath.WebAPI that i can parse the json.

Note: i use UiPath Studio and not StudioX

Excellent @raiko.m . I agree, StudioX might be a bit limiting. But generally speaking, the StudioX user base may not need this functionality.

Hello @NHoe - kindly mark @raiko.m 's post as solution if it solves your problem.

Thanks again @raiko.m - keep sharing your knowledge! :slight_smile: :+1:

Thank you

Hi,

now i upload the Project, i add a TryCatch Activity across read- / write range activity. For the case, the Excel sheet is in use during the runtime.

prj_dynamic_project_name.zip (47,5 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.