1. Home
  2. Workflows
  3. Working With Variables

Working With Variables

When talking about variables in the context of Bosbec WE, we are usually referring to metadata. Metadata is where we store data to be able to process it later.

While metadata can be permanently stored on the account resources, it is often used as a temporary storage space when used in a Workflow Context.

Metadata

When handling data in a workflow, you’ll typically store it as metadata. In most cases, there is a destination field where you can enter the metadata key to save data, though some jobs use predefined keys.

Getting data from a key dynamically looks like this:

{{metadata.key}} or {{resource.metadata.key}}

Saving data to a key looks like this:

metadata.key or resource.metadata.key

Resources

Resources can be permanent (on your account) or temporary (in a WFC). They include incoming API requests, units, lists, etc. Resources have metadata that can be accessed using this syntax:

{{[RESOURCE_NAME].metadata.[KEY]}}
{{[RESOURCE_NAME].[KEY]}}

To get the creation date/time of a resource:

{{[RESOURCE_NAME].createdon}}

This returns the date/time in the “u” format: yyyy-MM-dd HH:mm:ssZ.

Incoming Message

The incomingmessage resource has specific keys you can access:

{{incomingmessage.body}} – Message body
{{incomingmessage.htmlbody}} – HTML body of email
{{incomingmessage.sender}} – Sender address (string)
{{incomingmessage.receivers}} – Comma-separated list of all receivers
{{incomingmessage.receiver}} – Main recipient
{{incomingmessage.subject}} – Email subject

Incoming HTTP request resource

The Incoming HTTP trigger creates an HTTP resource. Access data using:

{{[RESOURCE_NAME].body}} – Request body
{{[RESOURCE_NAME].headers}} – All headers
{{[RESOURCE_NAME].header.[HEADER_NAME]}} – Specific header

Paths and URL:

{{[RESOURCE_NAME].path}} – Path only
{{[RESOURCE_NAME].fullpath}} or {{[RESOURCE_NAME].full_path}} – Full path
{{[RESOURCE_NAME].url}} – Full URL

Query parameters:

{{[RESOURCE_NAME].querystring}}
{{[RESOURCE_NAME].querykeys}}
{{[RESOURCE_NAME].query.[KEY]}}

Content type:

{{[RESOURCE_NAME].content-type}}
{{[RESOURCE_NAME].contenttype}}

Other useful properties:

{{[RESOURCE_NAME].multitude}} – Usually Single
{{[RESOURCE_NAME].requesterip}} or {{[RESOURCE_NAME].ip}} – IP address

IDs

Resources usually have an ID:

{{[RESOURCE_NAME].id}} – Resource ID
{{[RESOURCE_NAME].administratorid}} – Creator's admin ID
{{[RESOURCE_NAME].accountid}} – Creator's account ID

Share lists

To access sharing details:

{{[RESOURCE_NAME].sharing.owner}} – Resource owner
{{[RESOURCE_NAME].sharing.sharelists}} – Share lists
{{[RESOURCE_NAME].sharing.access}} – Access type (public/private)

Units

Units contain specific information, such as phone numbers, email addresses, and tags. You can use any unit resource name in place of “unit”.

Phone:

{{unit.phone}} or {{unit.phonenumber}} – Phone number
{{unit.phone.country}} – Country name from phone number
{{unit.phone.countryiso}} – Country ISO code (e.g., SE)

Email:

{{unit.email}}
{{unit.emailaddress}}

App Users:

{{unit.appuser}}
{{unit.appuserid}}

Other functions:

{{unit.hasfeedchannelwithpush()}} – true if user has push channel
{{unit.channels.count()}} – Number of channels
{{unit.tags.tojson()}} – Tags in JSON format

Variable functions

The Bosbec Workflow Builder includes built-in functions to alter and create data. For example, use these functions to create and format dates or generate random characters and values.

DateTime

{{[datetime()]}} – Default format (yyyy-MM-dd HH:mm:ssZ)
{{[datetime(yyyy-MM-dd)]}} – Custom format
{{[datetime(yyyy-MM-dd HH:mm:ssZ)]}}

{{[datetime().addtimespan(ddd.HH:mm:ss)]}} – Add days, hours, minutes, or seconds to the datetime.

{{[datetime().subtimespan(ddd.HH:mm:ss)]}} – Subtract days, hours, minutes, or seconds to the datetime.

Random generators

{{[rndnum(50)]}} – Random number 0 to 50
{{[rndnum(10,100)]}} – Number between 10 and 100
{{[rnddecimal()]}} – Decimal 0 to 1
{{[rndalpha(5)]}} – 5 random letters
{{[rndchar(X)]}} – X random characters
{{[uid()]}} – GUID

Case Conversion

{{metadata.[KEY].toupper()}} – Uppercase
{{metadata.[KEY].tolower()}} – Lowercase

JSON Conversion

{{metadata.[KEY].tojson()}}

Count

{{[RESOURCE_NAME].count()}} – Count items in resource

Default Value

Use defaultvalue() to provide fallback if key is missing or empty:

{{defaultvalue( "{{metadata.key}}" || "No value" )}}

This example would save the string “No value” to the destination if metadata.key cannot be found or if it’s empty.

Updated on 2025-07-15

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support