Using the Run function (Legacy) action

Use the Run function (Legacy) action to run a function within the .dll file and specify the parameters to pass a function and store the output as a variable.

  • Use a dictionary variable to pass the parameters to a function. The dictionary key contains the parameter name to pass to a function.
  • If the .dll file uses .NET functions or classes from another .dll file, you must add the second .dll file as a manual dependency of the bot.

    Bot dependencies

  • When you use Run function or the Run function (Legacy) action, ensure that you use the supported data types for DLL functions.

    See DLL package.

Procedure

Follow these steps to run a function:

  1. In the Actions palette, double-click or drag the Run function (Legacy) action from the DLL package.
  2. In the Session name field, enter the name of the session.
  3. In the Enter the namespace field, specify the namespace.
    You can specify any of the namespaces defined in the DLL file.
    Note: Ensure that the value you have provided in the field is correct.
    Important: This field is case-sensitive.
  4. In the Enter the class name field, specify the name of the class.
    You can specify the name of any classes available in the namespace.
    Important: This field is case-sensitive.
  5. In the Enter the name of function to be executed field, specify the name of the function to execute.
    Ensure that the name you have provided is correct and available in the class specified in the previous step.
    Important: This field is case-sensitive.
  6. Optional: In the Parameters to the function list, select the variable that contains all the parameters needed by the function.
    You can use Boolean, datetime, dictionary, list, number, string, or table variable types to pass parameters to the function.
    Note: Use the dictionary subtype Any to enable the bot to pass parameters of different data types to the function including Boolean, numeric, and string.
    Specify the dictionary key as the parameter name to provide the dictionary value as the parameter value. For example, you have a function ReturnSum that returns the sum of two numeric values and want to pass Param1 and Param2 as its parameters. Configure a dictionary variable with two keys: Param1 and Param2, each with the value that you want to pass.
  7. Optional: In the Assign output to variable list, select a variable to use to store the output of the function.
    You can use Boolean, datetime, dictionary, list, number, string, or table variable types to store the output based on the type of output the function returns.
  8. Click Save.