Skip to main content

Set PS Variable

Description:

Set PS Variable assigns values from workflow fields to PS (Process Studio) variables with either global or local scope. Use this step when you need to pass runtime values between different steps or sub-workflows within the same process — for example, storing a calculated total that a later step references, or sharing a file path across multiple workflow branches. Global variables persist throughout the parent workflow's lifecycle and are accessible by child workflows, while local variables are confined to the workflow where they are created.

Note: The PS variables set in this cannot be used for database connection details.

Configurations:

Field NameDescription
Step NameName of the step. This name has to be unique in a single workflow.
Execute even if no row is foundA checkbox to define if the step is to be executed in case no rows are received. By default it is unchecked.
Fail if field not foundA checkbox to define if the step is to be failed in case no field is specified. By default it is unchecked.
Field values (Tabular):
Field nameSpecify the field value which is to be assigned to a variable.
Variable nameSpecify the variable name which will be used further.
Variable scope typeSpecify the scope of the variable (Global or Local).

Note: Global variables are available throughout the lifecycle of the parent workflow/process. They can be created at any sub-level and it will be available after that to the entire scope. They will be destroyed after the main or parent workflow/process ends.

Local variables are available only in the workflow/process where it has been created.They are not available to the child workflow/process. The same variable name can be used for global and local scopes simultaneously. The value modified or fetched is completely based on the scope specified as mentioned in the note below.

The PS variables are added to the existing list which pops up on Ctrl-Space where applicable. The format of these variables in the list will be as ${GLOBAL.varname} and ${LOCAL.varname}. The PS variables created in ‘User Defined Java Class’ or ‘Modified Java Script’, are not visible in this list. However,

If the child workflow/process is already opened and a variable is added in the parent workflow/process. This variable is not reflected directly at design time (i.e. on Ctrl-Space) although

there no issues during runtime. There are two options for this,

- The user can type the variable name where required

- Reopen the child workflow/process (from Open referenced object) after the variable is added.

SecretSelect Y or N to set the secret status of the variable. The step applies the setting based on the data source.
- Incoming data (runtime override): If the referenced PS variable is marked as Secret in the PS Variables tab, the output field is automatically marked as Secret. The Secret field displays Y and cannot be changed.
-Default values: The Secret setting controls any static value entered in the Default Value field.
- Y: Protects the default value. The step displays a masked input dialog, encrypts the value in the saved workflow, and masks it (displays ********) during runtime.
- N: Keeps the default value visible as plain text.
Note:
- Workflow boundaries: The secret status is retained when passing data to parent workflows using the Set Workflow Result step. The step encrypts the data before sending it to the server.
- Lost protection on rename: Renaming a secret column using the Rename Fields step removes the secret status and exposes the data as plain text.
- Lost protection on modification: If a secret field is modified in an earlier step (for example, using a Calculator step to create "Token: " + secretField), the result is treated as a new field and is no longer protected.