Script Mapping

Updated by Luka Koczorowski

Script Mapping

In some scenarios, when Mapping Custom Actions or DLL Invocations a user may instead want to map those actions to inline scripts

Supported Languages

The following language are supported:

Target RPA Platform

Supported Languages

Power Automate Desktop

  • VBScript
  • JavaScript
  • PowerShell
  • Python
  • VB.NET
  • C# .NET
  • Robin Script

Map a Script

Using Rules Dashboard

Custom Actions and Unresolved References can be easily mapped to scripts using the dashboard in three steps

  1. Select Script Type

Using the Type column, select any of the RUN_ types that matches the desired scripting language

Robin Script (RUN_ROBINSCRIPT) is the backend scripting language for native PAD actions.
  1. Provide Script

Using the Script column enter the desired script to map the action to.

  1. Enable and Save Rules

Referencing Source Parameters

To allow for dynamic and contextualized scripts Blueprint has the ability to reference the source activities parameters using our special { } notation.

Example

Let's imagine we have a custom activity in UiPath that calculates the modulo of a given number by another and we are exporting to PAD

  • Activity Name: Mod
  • Input 1: Num
  • Input 2: DivideBy
  • Output: Remainder

It would look like this:

<Mod Num="MyNumber" DivideBy="MyDivider" Remainder="MyResult">

Since PAD supports modulo, we can replace this custom activity directly with robin script. However, we cannot simply export Num, DivideBy, and Remainder, as these parameters will be different depending in what context our Modulo activity is being used. In our example, Num is MyNumber but for another bot it could be MyNominator, or MyNumbers("Nominator"). To specify where to put the bot specific inputs and outputs, we use Blueprints {parameter} notation. To convert our example, we would use the following as our script:

SET {Remainder} TO {Num} mod {DivideBy}

Then when our example is exported, it will export as the following:

SET %MyResult% TO %MyNumber% MOD %MyDivider%

Using CSV

The following columns will be auto-populated by Blueprint's Rule Generator:

  • Column A ("ScopeId") = Scope for Rule. Blank implies Instance level
  • Column B ("SourceActionType") = CUSTOM_ACTION
  • Column C ("TargetActionType") = EXTERNAL_FLOW
  • Column E ("SourceObjectName")  = Custom Activity Namespace
  • Column G ("SourceActionName")= Custom Activity Method Name
  • Column N ("SourceParameterName") = Name of Parameter
  • Column R ("TargetParameterName") = Same as SourceParameterName
  • Column Y ("IsActive") = FALSE
A row will exist for every parameter. For example, a call to CustomActivity.Add(NumOne, NumTwo) will create two rows, one for parameter NumOne, and another for parameter NumTwo

Update the following columns

  • Column C ("TargetActionType")

Set this column to one of: RUN_VBSCRIPT, RUN_JAVASCRIPT, RUN_POWERSHELLSCRIPT, RUN_PYTHONSCRIPT, RUN_CSHARPDOTNETSCRIPT, RUN_VBDOTNETSCRIPT, RUN_ROBINSCRIPT

  • Column X ("DefaultValue")

Set this column to your described script. Scripts can be single or multi-line.


How did we do?