Skip to Content

Code Snippets

Snippets in Primo Studio RPA are pre-configured code blocks or workflows that simplify and accelerate development by reusing them in different projects.

Snippets are located in the left part of the Primo Studio RPA interface in the Code Snippets tab.
If the tab is not displayed, it can be activated as follows:

  1. Go to the Panels menu.
  2. Select Code Snippets.
  3. After that, the Code Snippets tab will appear at the bottom of the Studio interface.

snippets1.png

How to Use Code Snippets

Snippets can be easily transferred to a project using the drag-and-drop method. Double-clicking on a snippet will open it in a new tab in read-only mode, which prevents accidental changes to the main code.

Some snippets for frequently used functions are already pre-installed in the Studio. Using such proven code blocks minimizes the risk of errors that may occur when developing code from scratch.

Creating and Saving Your Own Snippets

To save your own snippet, follow these steps:

  1. Create a workflow, for example, a sequence with the necessary actions.
  2. Save the process in the desired folder.
  3. Specify the path to the folder with the created file so that it appears and becomes available in the snippets panel for further use.

Importing Activities

If you already have a ready-made code snippet that you want to add to the snippets:

  1. Open the Code Snippets tab.
  2. Click on Add Folder and specify the folder containing the snippet of interest.
  3. The selected code snippet will be added to the snippets panel and will be available for use in your project.

snippets2.png

Importing snippets into a project includes activities directly, not links to other processes.

Additional Information

Applying different types of snippets in the context of development, taking into account their integration into different processes:

  1. Snippets – Only Code (Pure Code)

    • Import into Pure Code: The snippet is imported as text.
    • Import into Sequence: The snippet is transformed and added as a C# element.
    • Import into Diagram (Workflow): The snippet is added as a C# element.
  2. Snippets – Sequence

    • Import into Pure Code: Import is not supported.
    • Import into Sequence: The snippet is imported as a set of elements.
    • Import into Diagram (Workflow): The snippet is added as a Sequence element.
  3. Snippets – Diagram (Workflow)

    • Import into Pure Code: Import is not supported.
    • Import into Sequence: The snippet is added as a Diagram element.
    • Import into Diagram (Workflow): The snippet is added as a Diagram element.
Last updated on