How to reference data using Double Braces

Learn more about Double Braces functions and how to use them in the Digibee Integration Platform.

You can use Double Braces in multiple ways: to access data received by the component in JSON format, to reference Globals, accounts or metadata.

Here’s how you can do this:

Referencing JSON data

Suppose a component receives the following JSON data about an employee named John Doe:

{
"firstName": "John",
"lastName": "Doe",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zipCode": "12345"
},
"phoneNumber": "+1-555-555-5555",
"email": "johndoe@email.com",
"age": 30,
"gender": "Male",
"occupation": "Software Engineer"
}

Referencing the whole data

To reference the whole JSON data received by the component, use the following syntax:

{{ message.$ }}

Here:

  • message is a reserved word that refers to the data that was received by the component in question, known as payload.

  • $ indicates that you are referring to the entire payload.

Referencing specific properties

Use the following syntax to reference specific properties of a JSON, replacing terms in angle brackets with the desired value:

{{ message.<property-name> }}

Here:

  • message is a reserved word that refers to the data that was received by the component in question, also called the payload.

  • property-name refers to the name of the desired property.

For example, if you want to reference John Doe’s email address, use the following notation:

{{ message.email }}

To access nested properties, use the dot notation recursively. For example, to reference John Doe’s ZIP code, use the following notation:

{{ message.address.zipCode }}

Referencing Globals

Globals are user-created variables that can be referenced in multiple pipelines. To learn more about Globals, read this documentation.

To reference a Global using Double Braces, use the following syntax, replacing terms in angle brackets with the desired value:

{{global.<global-name>}}

Here:

  • global is a reserved word.

  • global-name is the name of the desired global.

Suppose you want to reference a Global called “my-global”. Use the notation:

{{global.my-global}}

Referencing accounts

Accounts are user-defined credentials that can be referenced in multiple pipelines. Read our Accounts documentation to learn more about them.

To reference an account, use the following syntax, replacing terms in angle brackets with the desired value:

{{ account.<account-label>.<field> }}

Here:

  • account is a reserved word that refers to the accounts saved on the Digibee Integration Platform.

  • account-label refers to the account label on the accounts page.

  • field refers to the account field name on the accounts page, such as username, password, token, header-value, among others.

Suppose you want to reference the username of a saved account called emilys-account. To do this, use the following syntax:

{{ account.emilys-account.username }}

Referencing metadata

Metadata can refer to various types of data, such as information about the pipeline itself, the current execution of the pipeline, the configuration used to run the pipeline, and the environment in which the pipeline is executing.

To access metadata, use the following syntax, replacing terms in angle brackets with the desired value:

{{ metadata.<data> }}

Here:

  • metadata is a reserved word.

  • data refers to the metadata you want to access.

For example, use the following syntax to refer to the name of the pipeline in which this code is being executed:

{{ metadata.pipeline.name }}

These are all the metadata you can access with Double Braces:

Pipeline metadata

dataDescription

pipeline.name

Pipeline name

pipeline.versionMajor

Major version of the pipeline

pipeline.versionMinor

Minor version of the pipeline

pipeline.realm

Pipeline realm

pipeline.description

Pipeline description

pipeline.id

Pipeline ID

metadata.pipeline.project

Name of the project of the pipeline that is being deployed. During test-mode will be returned as null

Deployment metadata

dataDescription

runtime.consumers

Maximum amount of consumers, according to the pipeline deployment size

runtime.actualConsumers

Amount of consumers, as set by the user

metadata.runtime.environment

Environment in which the pipeline is being executed

Pipeline execution metadata

dataDescription

execution.key

ID of the current pipeline execution

execution.timeout

Configurated pipeline timeout

execution.startTimestamp

Pipeline start timestamp (in milliseconds, in UNIX Epoch format)

execution.redelivery

Boolean. True if this execution is an execution retry. False if not. Learn more about retries on our Pipeline Engine article

Referencing Capsule property

In the Capsule configuration, you can define properties for parameters and use them in the configuration of components within the Capsule flow.

Use the following syntax to refer to a Capsule property:

 {{ capsule.<property> }}
  • capsule is a reserved word that refers to the Capsule properties.

  • property is the property set in the parameter within the Capsule configuration form.

For example, if you have created a property called messageError in the Capsule configuration form and want to reference it in a component within the Capsule, use the following notation:

{{ capsule.messageError }}

Last updated