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.


When you need to handle data in a Workflow, you’ll likely need to store it as metadata. In most cases, there will be a destination field where you can enter the metadata key to which you want to save the data, but in some cases, the jobs have predefined keys.

Accessing the data is usually done in a source field.

The standard syntax for accessing and storing metadata to and from the WFC is: 


For example, accessing or saving to the key “location” would be done by typing metadata.location.


Resources can be found on your account (permanent) or in a WFC (temporary). Many different types of resources are available, e.g., incoming API requests, units, or lists of data log items. These resources can have metadata that can be accessed and used in the WFC.

To access metadata on a resource in the WFC, use the syntax below.


The [RESOURCE_NAME].[KEY] version is usually used when accessing data from an incoming HTTP request or a JSON.

Finding the date and time that a resource was created is done using the following syntax.


This gives you the DateTime in “u” format, i.e., yyyy-MM-dd HH:mm:ssZ.

Incoming Message

The resource “Incoming Message” has a few specific keys that can be accessed using the format below.

incomingmessage.body - Access the message body
incomingmessage.htmlbody - Access the HTML body of an email
incomingmessage.sender - Access the sender (String-object)
incomingmessage.receivers - Get all receivers in a comma separated list (incl. CC and BCC for email)
incomingmessage.receiver - Get the main recipient.
incomingmessage.subject - Get the email subject.


Most resources in the Bosbec WE platform will have an identifier. This is commonly accessed using the syntax below.


In addition, a resource will usually have the ID of the administrator and account that created it. This can be accessed using this format:


Share lists

Information about a resource’s share lists can be accessed with the following features.


These features will give you the owner of the resource, share lists they are included in, and if they are public or private.


Unit resources have specific data that can be accessed in the engine such as phone or email. The following commands are specific for unit resources. Note that where we are writing “unit,” you can use any unit resource name instead.

unit.phone / unit.phonenumber


Both “phone” and “phonenumber” will give you the unit’s phone number. “Country” will look at the phone numbers country code and give you the country name, while “countryiso” will give the two-letter country code, i.e., Sweden or SE.

Accessing the email address can be done with the following syntax.


App users are accessed in a similar manner:


You can also check if the user has an active push channel with the following function. This will give you a true or false value.


If you want to know how many channels a unit has, you can count them using the following function.


Tags can be accessed and listed by using this function.


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.


Current date and time.

Set the format inside the parenthesis, or leave them blank for standard format (yyyy-MM-dd HH:mm:ssZ).

[datetime(yyyy-MM-dd HH:mm:ssZ)]

Subtract time from the current date and time:


Add time to the current date and time:


Generate random

Generate a random number from 0 up to a certain number:


Generate a random number within a certain range:


Generate decimal value ranging from 0 to 1:


Generate X amount of random letters:


Generate X amount of random characters:


Generate a Globally Unique Identifier:



Set upper case. Add the function to the destination field.


Set lower case. Add the function to the destination field.



Get metadata and save it as JSON.



Count number of items in a resource. For example, count all units in a unit resource.

In the source field, add .count() to the end of the resource.

Updated on 2024-03-19

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