Objectif Lune joins Upland Software.Learn more >
Erik van den Heuvel
December 1st, 2021
In this post we’ll show you how to use runtime parameters to effortlessly pass variables to a template. Runtime parameters provide an elegant way to pass information from Workflow into the document creation process without having to modify the data records or data model. Keep reading to learn more!
Information that is needed to personalize a template sometimes only becomes available when a production process is running. To give a few examples:
In the past, production related information could only be passed to a template via the data. You may have found yourself adding the information to the ExtraData field or changing the data mapping configuration. That is no longer necessary.As of OL Connect version 2020.2, runtime parameters for content creation allow to pass variables to a template. The values of these parameters are dynamically set by Workflow and are then directly accessible in the template and available with all records in the data set.
The Parameters pane in the Designer provides the ability to view, add and change runtime parameters for templates. It is found next to the Data Model pane.
To add a runtime parameter:
The default value is used when a parameter is not set in the Workflow process.
In Workflow, the various Content Creation tasks display the list of runtime parameters that are expected by the template you select.
By default, each runtime parameter displays the default value that was specified in the template, but you can change the values to use any of the dynamic values available in Workflow, including data/metadata selections.
The runtime parameter defined in the above example provides the path to a dynamic media background image. The Control script to use that value could look like this:
let media = merge.template.media; if( merge.template.parameters.stationeryPath ) { let stationeryPath = merge.template.parameters.stationeryPath; media['Media 1'].stationery.front.enabled = true; media['Media 1'].stationery.front.url = stationeryPath; }
The parameters are accessed via the template property of the merge object.
The following script sets the action of an HTML form in a Capture OnTheGo template. The selector of the script refers to the <form> element (not shown here).
<form>
var cotgHost = merge.template.parameters.cotgHost; results.attr('action', cotgHost);
Tip: Runtime parameters also exist for other tasks – data mapping, job creation and output creation – and are used in much the same way.
Tagged in: parameter, Template
Receive exclusive OL products news, tips and resources.
Your email address will not be published. Required fields are marked *
Notify me of followup comments via e-mail. You can also subscribe without commenting.
Δ