1. Home
  2. Workflows
  3. Workflow Builder Expression Syntax

Workflow Builder Expression Syntax

During the lifespan of Bosbec WE and the Workflow Builder, there have been different iterations of the expression syntax used in the properties fields and resources. While each iteration and implementation of a new syntax was made to solve a shortcoming of the previously existing syntaxes or to make things clearer, this has led to a mix of syntaxes in various jobs, making it unclear which to use. To rectify this, we are currently working on implementing an alternative expression syntax to streamline the building process.

This page explores the two different versions and how to use them. While we are implementing support for the new syntax in most jobs, this is an ongoing process, and some jobs or individual properties may still not support it. However, we suggest using the alt1 syntax as much as possible but falling back on the legacy syntax where the new syntax is not yet supported. This approach will make transitioning to the new syntax easier in the future.

If you are using the alt1 syntax and find a job or properties field that does not yet support it, please let us know through the contact pages or the help center in the admin panel.

Legacy

Legacy is the mixed syntax used in most jobs. If not changed, this is the default for now. The list below provides an example of the different syntaxes in different jobs.

metadata.key
{metadata.key}
{{metadata.key}}
[metadata.key]
[key]

In most cases, these can also be prefixed with a resource name, such as unit_resource.metadata.key or incomingmessage.body. More on this can be found in Working With Variables.

If in doubt, hover the information icon next to most input fields to show a tooltip with a suggestion on how to format the string. If this is missing, please let us know through the same channels stated earlier.

Alt1

Alt1 is the main candidate for replacing the legacy syntax, and some of the newer jobs, such as the pipeline jobs, have already had this implemented as default.

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

Using the curly brackets indicates that the workflow should search for a value matching the key and replace the string, and leaving them out will leave the string as is.

Selecting syntax

The first way to change the syntax is to open the trigger’s properties and change the selection in the dropdown menu, as seen below.

The second way is to replace the custom settings in the workflow context. You can do this by setting the settings.customsettings._expression_syntax to alt1 or an empty value (for legacy syntax).

Updated on 2024-07-10

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