Parameters and Fields

In this Page

The use of parameters ( _parameters) and fields ($fields) varies depending where you are within the SnapLogic Elastic Integration Platform and the type of property in which you use them. The following sections explain how they can be used.

Parameters are string values.

Expression Properties in Snaps

Within properties that can take expressions:

  • Both _parameters and $fields are available.
  • Exceptions

    • The database Insert/Table List Snaps do not allow input fields to be referenced; only Pipeline parameters are available.

    • $fields cannot be used in binary Snaps, only in Document Snaps. A common error is trying to reference an upstream Snap $field in a File Writer.

JSONPath Properties in Snaps

  • Fields are available.
  • Pipeline parameters can be accessed in expression components in the path. For example, to access a field that is specified by a Pipeline parameter you can write: $.foo.bar[(_myParam)].
  • Pipeline parameters cannot be mixed into the result of a JSON-path query.

Velocity Templates in Generator Snaps

  • Both are available, however, the syntax is different since you're working in the Velocity Template Language.
  • Pipeline parameters are accessed using, ${_parameter}, such as:
[ 
 { 
 "remove_user" : ${_user} 
 } 
]
  • Field references cannot use expression language or JSON path features.

Dynamic Database Queries

  • $.eval() can be used to either substitute Pipeline parameters, such as CUSTOMER_ID = $.eval(_parameter) or execute functions, such as $.eval(Date.now()) without having to use an expression toggle (=).

SQL Substitution

  • Only simple fields will work; spaces or special characters (including $) can not be in the field name unless they are treated as a string, such as $['Home address'].
  • To use a parameter in a SQL select statement, you can use a Mapper Snap before the SQL Snap to turn the parameter into an input field, which can then be used in the where clause using the $param syntax. 

Script Snap

  • Pipeline parameters are available by using scriptVarName = $_whateverPipelineParamName.