Sometimes its valuable to bring context variables in from an external file at runtime. For this, the tContextLoad component can help. The following job design will give a quick tutorial to give some understanding on to how this component works. You can download the file used in this tutorial here: context.

Step 1: Set Up Context

In this job, open the Context tab and add three variables, in this case I’ve made them city, state, and zip. There is no need to assign any values to them.

Step 2: Files to Context

Drag a FileInputDelimited component and the tContextLoad component onto your canvas, connecting them as shown below.

Entering the component tab, select the FileInputDelimited component, and sync columns with the ContextLoad. Add the input file in file name. After this, open the component for the ContextLoad variable and enable the “Print operations” option.

Step 3: Viewing results

The previous steps, when run, will successfully load your new variables with values. To view these, we must make a new subjob. Add in a FixedFlowInput and connect it to a LogRow component. Then have this run off a trigger on subjob ok from the first job.

Edit the schema in the fixedflow component and add three columns. The names of these don’t matter, but make sure each of your saved context variables are accessed, as shown below.

Finally, run the job and see your output.

Notice the first three lines are generated by the “Print operations” option enabled in the ContextLoad component, telling you the values loaded.

Leave a Reply


captcha *