chesterdocs

#Fixed values, variables and expressions in a field

A field holds a fixed value, a variable or an expression — a field with a structure, such as a request body, can also be written as one expression that builds the whole object.

#Three ways to fill a field

flowchart LR
  F["A field in the<br/>properties panel"] --> I["Type a value<br/>'Acme Ltd' · 42"]
  F --> V["+ Pick variable<br/>Activity_fetch.customer"]
  F --> X["ƒ Edit as expression<br/>Activity_fetch.total * 1.19"]
  I --> S["Stored as an expression<br/>&quot;Acme Ltd&quot; · 42"]
  V --> S2["Stored as the reference"]
  X --> S3["Stored as written"]

Every value field has a + and a ƒ button:

  • Typed in — a fixed value. It is stored as an expression too: a text in quotes, a number or true/false as they are.
  • + Pick variable — a reference to data from an earlier step. It replaces the value.
  • ƒ Edit as expression — anything computed. See Write an expression.

The field decides for itself which of the three it shows, from what is stored.

#A whole object as one expression

Fields with a structure — a Request body, the Input parameters of a sub-process, Form data input, Option data — show one row per field. Instead, the whole structure can be written as one expression with ƒ:

{
  customerId: Activity_fetch.customer.id,
  total: Activity_fetch.items.reduce((sum, i) => sum + i.price, 0),
  note: "Created by Chester"
}

Which top-level shape a field accepts:

Field Top level
Request body an object, a list or a single value
Pre-steps and additional steps of an inbound action a list
Path and query parameters, headers, registration body, sub-process inputs, Form data input, Option data an object

A field that gets the wrong shape — for example a text where an object is required — fails when the process runs.

⚠️ An expression that cannot be read, or that has the wrong shape, is reported the same way: Whole-Expression konnte nicht geparst werden — in German.

#Text with values in it

There are no placeholders such as {{ }} in ordinary fields. To put values into a text, use a template: `Order ${StartEvent_order.orderId} for ${Activity_fetch.customer.name}`.

In a template, a list becomes its items joined by commas, an object becomes [object Object], and a missing value becomes the word undefined. Pick the fields you need.

The email content of a send task is the exception: there + inserts a value into the text, and ƒ a calculation. A value that is missing there is simply left empty.