Get started
Working with Types: Formula, Fields and Values
Segmenting audience using Workflow nodes
Criteria Filter and Criteria Split Workflow Actions
Configuring nodes like Criteria Filter and Criteria Split involves selecting from a range of data types. This article explains these types—formulas, fields, booleans, strings, numbers, arrays, and their application within node configurations.
Configuring criteria conditions
Criteria FilterInsert Definition Here
and
Criteria SplitInsert Definition Here
nodes allow you to configure criteria using various data types. Field or Formula can be selected to define the source of the value for comparison, and an appropriate Value is then assigned. An
Operator determines the relational condition, such as 'less than', 'equals', or 'contains'. The type on the right-hand side—be it Field, Formula, String, Number, Boolean, or their array variants—determines the nature of the comparison parameter, complemented by the corresponding Value input for the condition.
Formula
Formulas allow you to calculate expressions in real-time, when criteria are being evaluated during an experience.Insert Definition Here
Formulas can be entered on the left or right hand side of an operator when the formula type is selected. When the formula Value field is selected, a formula picker dropdown will appear to help you write formula expressions:
The following formulas and arguments are currently supported:
DateAdd("interval", number, instant)
Returns the result of adding the number of intervals to the given instant (e.g. add 5 days from now). An instant refers to a specific point in time that serves as a reference for calculating timestamps. This could be the current date and time or the start of an experience.
-
interval— SECONDS, MINUTES, HOURS, DAYS -
number— The number of intervals to add (e.g. 5). This can be negative. -
instant— The instant to add to, representing a precise moment in time. This can be the current datetime returned byNow()or the starting point of an experience returned byExperienceStart().
Now()
Returns the current datetime instant
To add 5 days to the current date and time, you would use DateAdd("DAYS", 5, NOW()). This formula calculates a new datetime that is exactly five days from the exact moment the formula is evaluated.
ExperienceStart()
Returns the instant the experience started (when the flow triggers for an individual recipient)
If you need to add 10 days to the moment an experience began, such as a user starting a trial or subscription, you would use DateAdd("DAYS", 10, ExperienceStart()). This helps in scenarios where actions or reminders need to be scheduled based on the start of an experience.
Examples
| Use Case | Formula Expression | Operator | Comparison Value | Description |
|---|---|---|---|---|
| Follow-up reminder | DateAdd("DAYS", 30, Now()) |
less than or equal to | Current date | Triggers a reminder when the current date is equal to or has surpassed the 30-day follow-up date. |
| Subscription renewal | DateAdd("DAYS", -10, ExperienceStart()) |
greater than or equal to | Subscription expiry date | Initiates a renewal reminder when the current date is within 10 days before the subscription expiry date. |
| Post-trial engagement | DateAdd("DAYS", 14, ExperienceStart()) |
equal to | Trial end date | Engages users 14 days after their trial started, aligning with the trial end date for follow-up actions. |
| Offer expiration | DateAdd("HOURS", -24, Now()) |
less than or equal to | Offer expiry date | Checks if an offer expired within the last 24 hours, potentially to offer an extension. |
| Membership anniversary | DateAdd("YEARS", 1, ExperienceStart()) |
equal to | Current date | Annually checks if today matches the anniversary of the membership start date to trigger celebratory or renewal actions. |
Field
The Field type allows referencing data directly from fields available in the flow. Begin typing in the input to search and select from available fields, which dynamically populate based on what's available in the merge field explorer. Field types also support referencing array values, such as string[], number[], or boolean[] where available.
For example, using the field City from your system of record, you could use the field type and add a value (for instance, Sydney) to filter recipients based on whether their city is Sydney or not. If your merge field explorer includes a field like Tags (a string[]), you can use the contains operator to check if a recipient has a specific tag.
String
The String type is used for text comparisons. Each character in the text is compared one at a time. You may also encounter string[] (array of strings) in payloads with multi-valued fields.
For example, you can specify exact text to match against a field's value, or use contains to find a substring within a string or a value within an array. The City field might be paired with the string value Sydney to target users specifically in that city, or Tags (as a string[]) to find anyone with the "VIP" tag.
When using operators like "greater than" or "less than" in string comparisons, the order may not be what you expect. For example, "2" is greater than "11", and "Cat" is less than "catalog" because uppercase letters sort before lowercase.
Boolean
The Boolean type supports true or false values and can also support boolean[] (array of booleans) in advanced cases. This type is ideal for fields that store binary data, such as isActive or emailVerified. Arrays can be used with the contains operator to check if any value in a list matches your criteria.
Number
The Number type is used for numerical comparisons, supporting both single values and arrays (number[]). This is useful for fields that store numeric values, such as age, quantity, or thresholds, and now for multi-valued fields such as IDs, codes, or amounts. Use the contains operator to check if a specific number appears in an array of numbers.
Usage scenario: Offer expiry example
As an example, you can use Criteria filter to create an offer expiry period in the flow.
When a recipient replies to the original outbound SMS, the reply will come back into Pendula, and the split will check whether it was received before the expiry - i.e. was it received 2 days before or 2 days after the original message was sent?
In the criteria builder:
- LHS Select type =
formula -
Enter the formula =
DateAdd ("DAYS", 2, ExperienceStart())(2 days from when the experience started)
- Select operator =
less than - RHS Select type =
formula - Enter the formula
Now()
This checks that the inbound message was received less than 2 days ago and the recipient has replied, so they can continue through the ‘success’ path of the split.