Introduction

This article describes how to create variables that are over 1MB in size.

Problem

At the time of writing, you cannot paste data over 1MB in size directly into the Variables Properties interface — this applies to both global and task variablesClosed Variables are created and used extensively throughout and can either have fixed values or values that are dynamically populated when a task is run. Task variables are only available for the specific task they are created for. Users with Task Administrator rights can create task variables..

For example, you have a base64 encoded image that you want to use in a task. You want to pass the image through the task using a variable rather than through a recordset. When you paste the base64 string into the variable, it is truncated.

Solution

Instead, you use a separate tool that reads the data in and populates the variable for you.

Required Tools

To resolve this situation, you need the following tools:

Run VBScriptClosed The Run VBScript tool is used to create a task step that runs a Visual Basic Script using data produced by other steps in the task.
If creating a global variableClosed Variables are created and used extensively throughout and can either have fixed values or values that are dynamically populated when a task is run. Global variables are available for all tasks in this BPA Platform installation. Once created, global variables can be used by any task., it is recommended you create a task specifically for the Run VBScript tool to do the conversion
If creating a task variableClosed Variables are created and used extensively throughout and can either have fixed values or values that are dynamically populated when a task is run. Task variables are only available for the specific task they are created for. Users with Task Administrator rights can create task variables., you can add the Run VBScript step to your existing task

Populating the Variable

Whether creating a global or local variable, do the following:

  1. Save the variable contents to a text file in a location accessible by your BPA Platform instance.
  2. Create a blank global or task variable as required, that is, leave Current Value (global variablesClosed Variables are created and used extensively throughout and can either have fixed values or values that are dynamically populated when a task is run. Global variables are available for all tasks in this BPA Platform installation. Once created, global variables can be used by any task.) or Default Value (task variables) blank.
The variable must be Type: Variant
If a task-level variable it must also be a Parameter variable, with Parameter Attributes set to In, Out
For task-level variables, Scope can be set to either Task or Task Instance depending on your task requirements
  1. Add a Run VBScript step to the relevant task.
  2. Add a meaningful Name to your step.
  3. Go to the Main tab.
  4. Add the following script:

filePath = "<folder_path_and_filename>"
Set objFile = CreateObject("Scripting.FileSystemObject")
Set objText = objFile.OpenTextFile(filePath)

text = objText.ReadAll

objText.Close

Set obj = Nothing

Set objFile = Nothing

where folder_path_and_filename is the full path to the variable's text file.

  1. Drag the variable from the Task Browser to the end of your script and add <space>=<space> text after it.

    Your script should now look like:

    Run VBScript - Convert base64 Encoded File to Variable

    The example above uses a global variable (System.Variables). If using a task variable, it shows Variables instead.

  2. Click OK to save and close the step.

The empty variable is now populated and available for use in another or same task.