Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Variable Insertion (Interpolation) is a way to dynamically modify a string expression , or object at runtime. 

Usage Engine uses curly brackets to indicate that a Variable Insertion will take place. The variable insertion is supported in some Functions' configuration fields and also within Script and Script Aggregator Functions.

Within the curly brackets, you can access variables that belong to different scopes and use them to generate a dynamically changed output at runtime. Depending on what you want to achieve or manipulate, the output from Variable Insertion can be a string, (if prefixed by '$') or an object( if prefixed by '@' ).

...

Info
title$ or @

While using '$' or '@', note the following:

  • ${scope} will result in a string. ${scope} behaves like a JavaScript template Variable Insertion with the following exceptions: 

    Note
    iconfalse
    • Returns 'undefined' instead of throwing an error when accessing non-existing paths
    • Returns full object (payload) for ${payload}
    • Returns a JSON representation of objects instead of [Object object]


  • @{scope} will result in an object

Example
If you have a nested data structure in payload.foo, and you want to keep the structure and not transform it into a string, then you must use @{payload.foo} instead of ${payload.foo}.


Variable Insertion with Scopes 
Anchor
table
table

...

 You can use Variable Insertion using the following scopes/variables/objects only:

...