studio
2022.10
false
UiPath logo, featuring letters U and I in white
Studio User Guide
Last updated Nov 18, 2024

About Libraries

A library is a project which contains one or more workflows that can be reused as activities in other projects. Libraries are saved as NUPKG files when published and can be installed as dependencies from the Package Manager.

For example, you could create a library that collects data from an Excel spreadsheet and appends it to another, as explained in the Creating a Basic Library page. Next, the library can be packaged and used in other processes as an activity.

Creating a Library

  1. Go to the Studio Backstage View > Start > Library. This opens the New Blank Library window.
  2. Fill in the name and pick a location for the library. The default location is C:\Users\<current_user>\Documents\UiPath. Add a description, select the project compatibility and language, and then select Create. The new library is created and saved on your local machine.
    Note:
    • The library name cannot exceed 128 characters, and the description cannot exceed 500 characters.
    • Do not use lib as a library name, as this will result in a compile error in projects where the library is installed.
  3. The Project Panel displays the tree view with the Project folder, Dependencies, and the NewActivity.xaml which contains the actual workflow.

    Each workflow file in a library is available as an activity in projects where the library is installed as a dependency. If you want to make a certain file private, right-click it and select Make Private. In this case, the file is included in the library package, but it is not available as a reusable component in the Activities panel.

    Note: By default, the dependencies available for new libraries are the same as those for new projects with the Lowest Applicable Version runtime rule.

Extracting a Project as Library

You can extract any process or test automation project as a library to be reused in other projects. For example, you can convert a test automation project to use its templates in other automation projects.

  1. Open a project in Studio.
  2. In the Project panel, right-click the process node, and then select Extract as Library.


  3. Configure the following Extract Options:
    • Include Test Cases: By default, this option is enabled for a Process project and disabled for a Test Automation project. You should enable this option if you want to include test cases as part of the extracted library.
    • Publish and install the library: Automatically selected to publish the package to a shared feed and install the library as a project dependency. You can disable this option if you want to create the library without publishing it. If disabled, the remainder options are not available for configuration.
    • Alter your workflows after the package install: Choose to modify the workflows with activities that have been compiled from the library.

      • Replacing Mode: Choose the workflow replacing method.
        • Select Replace invoked workflows content to change the workflows invoked from entry point, or test cases with corresponding activities from the extracted library.
        • Use this option if you use the Isolated and Target Sessions properties for Invoke Workflow activities to run in a separate Windows process, and start in a different session, respectively.
        • Select Replace "Invoke Workflow" activities to change the Invoke Workflow activities with activities from the extracted library.
        • Do not select this option if you are using the Isolated and Target Sessions properties for Invoke Workflow activities.
      • Delete replaced workflows: Delete the workflows that have been replaced by the extracted library activities.
    • Set Execution Templates from library: Add execution templates to the library.
  4. Click Ok to confirm the library options.


  5. Click Create to finish library creation.


  6. (Optional) Publish the library if you've selected Publish and install the library in step 3, and then click Publish.


    Note: In case you didn't enable the Publish and install the library option, you'll be prompted to open the library or continue with the current project.


    Important: Replacing workflows or invoked activities from the extracted library will not take place for workflows where mock testing is used.

Configuring the Layout of an Activity

Arguments you define in the library become activity properties in the projects where the library is installed as a dependency.

To configure the look and the behavior of an activity when it is used in a project, right-click the workflow file in the library Project panel, and then select Activity Layout. The activity properties window is displayed with different options depending on the library compatibility (Windows - Legacy, Windows, or cross-platform).



Options for Windows and Cross-platform libraries

Select Activity Properties in the left-side menu, and enter the following:

  • Display name - The activity's name displayed in the Activities panel.
  • Tooltip - The tooltip that is visible when you hover over the activity in the Activities and Designer panels in projects where the library is installed.
  • Help Link - The help link that opens when you select the activity in the Designer panel and press F1 on your keyboard.
  • SVG Icon - The SVG icon to display next to the activity name.
  • Color - The highlight color displayed for the activity in the Designer panel.

The arguments defined in the workflow file are listed under Activity Properties in the left-side menu.

  • To customize the generated property, select it and configure the following:

    • Display name - The label that appears in the activity for the property.
    • Tooltip - The tooltip that is visible when you hover over the activity property.
    • Input Type - The type of input for the property. You can use the default input for the property type or select an input option depending on the type:

      • Boolean - Toggle (default), Condition builder, Radio button.
      • Numeric (int, double, decimal, long, short, sbyte, byte, ulong, ushort, unit, float) - Number editor.
      • String - Text composer (default), Rich Text composer.
      • String[] - String array.
      • Date Time - Date Time selector.
      • Time Span - Duration selector.
      • Dictionary - Dictionary builder.
      • All other types - Input (expression editor).
    • Placeholder - THE Placeholder text to display for the input when no value is selected.
    • Required - Whether the property is required.
    • Advanced Only - Whether the property should only be displayed in the advanced options section of the activity. Properties from the advanced options section can also be organized in categories.
  • To add a category under which to group multiple related properties, select New Category in the lower-left side of the window. Categories are available only in the advanced options section of the generated activity and can be expanded or collapsed. If a category is empty, it is removed when you click Save to close the window.
  • To change the order of properties and categories, or add properties to categories, drag-and-drop the items in the list.



Options for Windows - Legacy libraries

Select Activity Properties in the left-side menu and enter the following:

  • Tooltip - The tooltip that is visible when you hover over the activity in the Activities and Designer panels in projects where the library is installed.
  • Help Link - The help link that opens when you select the activity in the Designer panel and press F1 on your keyboard.

The arguments defined in the workflow file are displayed under Activity Properties in the left-side menu.

  • To customize the generated property, select it and configure the following:

    • Display name - The label that appears in the activity for the property.
    • Tooltip - The tooltip that is visible when you hover over the activity property.
    • Required - Whether the property is required.
    • Advanced Only - Whether the property should be displayed only in the Properties panel. If selected, the property is not displayed in the Designer panel for the generated activity.
  • To change the order in which the properties are displayed in the activity, drag-and-drop them in the list.

    Note:
    • In the case of libraries, it is recommended to use Nothing to assign a null value to a variable, rather than "". This is done to avoid any inconsistencies when using the packaged library as a dependency to a project.
    • The ImplementationVersion property of the System.Activities.ActivityBuilder object is not supported. Setting a value for this property results in arguments not being saved. This object is displayed in the Properties panel when you select the blank area of the Designer panel.

Adjusting Library Settings

To configure the settings of a library project, open the Project Settings window by clicking Settings in the Project panel.



The following options are available in the General tab:

  • Name - edit the name of the project.
  • Description - edit the description of the project.
  • Automation Hub URL - URL of an Automation Hub idea linked to the project. For more information, see Linking a Project to an Idea in Automation Hub.
  • Project Icon - optionally, define a custom icon for the project. You can browse to and select a file, or enter a path or public URL to an ico, jpeg, jpg, or png file up to 1MB in size.

    After the project is published, the icon is displayed next to the package in the Manage Packages window in Studio.

  • Compile activities expressions - set to Yes to compile and package all activities expressions with the library. This results in an improved execution time. Available for Windows - Legacy libraries only.
  • Ready to Run - set to Yes to optimize the generated assemblies for faster JIT compilation at runtime. Available for Windows - Legacy libraries only.
  • Modern Design Experience - set to Yes to enable a modern experience of working with UI Automation, including new and improved activities, recorders, and wizards, as well as the Object Repository.

Publishing a Library

Publishing libraries is similar to publishing processes. For more information, see About Publishing Automation Projects.

Limitations When Using Libraries

When using libraries, take into account the following limitations:

  • Due to NuGet limitations:

    • You cannot publish libraries to locations that contain user-restricted subfolders using Windows environment path variables.
    • Release notes for published libraries are visible only in Orchestrator.
  • Libraries with special characters in the names of .xaml files they contain may not be successfully published.
  • If a library contains a .xaml file and an argument that have the same name, the library cannot be published.
  • Library projects with the Windows - Legacy compatibility cannot be published if they contain Invoke Workflow File activities with the Isolated option selected. An error message is displayed in the Output panel when you try to publish. This limitation does not apply to libraries that use the Windows or cross-platform compatibility.
  • When using Invoke Workflow File activity, make sure the invoked file is located in the same folder as the library project.
  • The Launch Workflow Interactive activity is not supported for libraries.
  • Using Invoke Workflow File inside a library to reference the library itself is not supported.
  • If a library contains an activity that accepts a file path as input, to ensure the path is resolved correctly in projects where the library is installed, add the UiPath.Constants.Project.Location global constant when referencing the path (use this exact capitalization). This disables changing Environment.CurrentDirectory to the library folder at the start of execution for a library activity and uses the constant instead.

    For example, if a file named Employee.txt located in the InputData subfolder in the library project is used inside a Read File activity, provide the path as follows:

    UiPath.Constants.Project.Location+"InputData\Employee.txt"

    Note: The constant must not be used in Invoke Workflow File activities inside libraries.
  • To reference a location from the project folder where a library is installed, pass the path to the library as an argument.

Adding Reusable Components to Automation Projects

  1. Open or create a new project.
  2. Under the All Packages category, pick the feed under which the library is saved and install the package.
  3. Select OK and the package is added to the project definition.
  4. The activity is found in the custom category of the Activities panel.

Considerations for installing libraries in projects

  • Libraries with the cross-platform compatibility can be installed in cross-platform and Windows projects. Windows - Legacy and Windows libraries can only be installed in processes that have the same compatibility.
  • Errors may occur when you run a project that contains custom activities from a library that was created in a Studio version prior to 2019.10.1 and published from Studio 2019.10.1 or later. In this scenario, you must recreate and republish the library.
  • When using Import Workflows to add a workflow that contains a library in a library project, the dependencies referenced in the library are not imported.
  • When importing two versions of the same custom library in a project, the extra custom activities contained only in the second library are not visible in the Activities panel unless you remove the first imported library.
  • Using periods (.) in the library name separates the library into nested groups when viewing it in the Activities panel.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.