Modifiers

You can select a variable in your expression and modify it to customize the result of the variable value, based on the position of its characters or on its length.

To add a modifier based on the character position, follow these steps:
  1. Select the variable (you can do this in the parameter field or in the Expression builder editing window).
  2. If needed, edit the options of the variable.
  3. Select one of the two options:
    • Characters Of in case you want to modify the variable based on the characters.
    • Length Of in case you want to modify the variable based on the length.

Example 1: based on the characters.

There is a variable Cusname in your workflow and you want to use it to build a path. However, you don't want to use the full result of the variable, but only the first three characters of the variable value. To do so, select the Cusname variable and select Add Modifier. Configure the modifier like this:

This will result in an expression that contains the first three characters of the customer name in stead of the complete customer name.

By selecting Add Modifier, you can define more than one modifier for a variable. Note that in that case, the system will read the modifiers top-down, where the second modifier is extracted from the outcome of the first modifier. Select Save to save your changes, select Cancel to discard your changes.

In the example below, the first modifier will read all characters starting from the first underscore till the end of the customer name value. The second modifier will start from that result and will therefore build a value containing the first three characters starting from the underscore.
You can also use the length of the selected node outcome.
  • In case of a string this is the number of characters.
  • In case of an object and array this is the number of entries.
  • In case the other objects this is 0 or 1.

Example 2: based on the length

Before submitting a job, the user needs to enter all the customers on a customized form, where all the customer names are stored in the variable key Clients:
You want to route on the number of customers the user enters in the form: 1 when the user enters 1, 2 when the user enters 2, 3 when the user enters 3 and mismatch for all the rest of the entries:
In this case you can use the length of the variable key that you used in the customized form (Clients):

The list is an array, so if the user enters 1 customer, the length is 1 and the workable will route to output 1.