Articles → UIPATH → Create Your First Library In Uipath
Create Your First Library In Uipath
Purpose Of Library
Scenario
Create The Library
- Go to "New Project" and select "Library".
Click to Enlarge
- A popup window will come to enter the project name and path. Click on the "Create" button.
Click to Enlarge
- Once the project is created, go to the file "NewActivity.xaml".
- Inside the "NewActivity.xaml", create 2 arguments. The argument "inputFolderPath" inputs the folder path and the argument "outputFilesCount" is the output argument that returns the count of files.
Click to Enlarge
- Drag and drop the "Assign" activity and set the value to "outputFilesCount" arguments.
Click to Enlarge
- Save the library project.
Publish The Library
- Click on the "Publish" button in the "Design" tab.
Click to Enlarge
- A window will appear to set the project properties. Click on the "Next" button.
Click to Enlarge
- In the next window, select the "Publish options". Here, set the "Publish To" to "Custom" and set the "Custom URL" to the local path.
Click to Enlarge
- Click on the "Publish" button.
- Once the publish is completed, you will get the following message.
Click to Enlarge
- The package is created with the file extension ".nupkg".
Click to Enlarge
Add Library In Uipath Studio
- Go to "Home" → "Settings" → "Manage Sources".
Click to Enlarge
- Click on the "+" button to add the package path.
- Enter the "Name" and "Source" and click on the "Add" button.
Click to Enlarge
Use Library In The New Project
- Create a new project of type "Process".
- Once the project is created, click on the "Manage Packages" in the "Design" tab.
- A popup window will appear. Go to "MyPackage" and click on the required library.
Click to Enlarge
- Click on "Install" and then "Save".
- Once installed, the library will appear on the activities window.
Click to Enlarge
- Drag and drop the "NewActivity" activity and set the arguments.
- Finally, display the count in the message box.
- Save and run the bot.
Click to Enlarge
Output
Click to Enlarge