Parameter Example: Using Production Loop Node

You can define parameters in Visual Integrator (VI) and Production that allow you to loop through numerous runs of a VI script.

Assume you have a data file containing three columns (City, State, and ZIP) like this Closedexample.

Zip Code Input File

You want to process the data to have a fourth column that concatenates the first three columns (City-State-Zip) like this Closedexample.

Zip Code Output File

You have files from three states to process (NJ. NY, and PA), each file named in the format <state abbreviation>_zip-codes.txt.

You can create a VI script to do the concatenation, which creates the fourth column and a Production scrip that uses a loop node to process three runs of the VI script—one for each state's file. You use parameters in both scripts to help simplify the processing.

Setting and Using a VI parameter

In the VI script, you create a parameter called state on the Parameters tab at the bottom as shown Closedhere. See Creating Parameters in Visual Integrator.

Setting the VI Parameter for Zip Code Example

Now you can use the state parameter for the <state abbreviation> portion of the file names in both the input object and the output object.

Input object Closedexample:

Using a Parameter in the Input File Name

Output object Closedexample:

Parameter Used in Output File Name

See Inserting Visual Integrator Parameters for how to insert parameters.

Setting and Using a Production Parameter

You create a Production script with a loop node to execute the VI script for each of the three input data files.

You set the Production parameter values for the loop node at the bottom of the loop node properties panel as shown in this Closedexample.

Parameters for a Production Loop Node

When you select the VI Script for the Integ process node, an informational dialog box appears stating that Production will retrieve existing parameters within the script.

The Parameters section populates with the parameter from the VI script. In this Closedexample, the parameter is named state and it has the value $(state).

Parameter Brought into Production Integ Node

TIP: If the VI script parameters do not display, you can right-click the script row in the Integrator Scripts section and click Retrieve Parameters from Script.

When you run the Production script, it now uses the Production and VI parameters to process the three input files into three output files with the added fourth column.