Actions

An action is the effect of a satisfied condition. A condition can have from zero to several actions, executed top to bottom, and each action sees what the previous ones wrote.

What follows applies to every action. The configuration and the behavior specific to each action are on its own page.

Source, settings, and result

Three actions look up one piece of data and publish what they found: run analysis, enrich, and extract IP prefix. In all three the configuration follows the same shape:

  • Source: which event fields feed the action, when the action reads any;
  • Settings: parameters specific to the action, among them the Result, the name under which the action publishes its readings;
  • Publishes: the keys the action produces, listed under Published keys.

Published results

A producing action writes nothing into the event. The action publishes each reading as a temporary variable, in the form %<result>.<key>. The following conditions and actions read that variable. To write a reading into the event, add a set field in expression mode after the producing action:

Condition:  $card_bin != null
Actions:    Enrich: Issuer by BIN                     (result: issuer_bin)
            Set field: issuer_country = %issuer_bin.issuer_country

The Published keys list shows each key, its type, and when it is present. Clicking a key inserts, right after the action, a Set field with the key’s expression. All that is left is to choose the destination field.

Separating reading from writing keeps in the event only what needs to outlive it. A reading used only to decide does not take up a field.

The result name is unique within the rule. Two actions cannot publish under the same name, in any condition. To run the same analysis or the same enrichment twice, give each action its own Result.

The action does not publish a key it could not resolve. A Set field that copies an absent key writes nothing, and the destination field stays as it was. The choice is intentional. An empty field can still be tested by a later condition ($issuer_country == null), and no guess is better than wrong data. false and 0, on the other hand, are legitimate readings and are written normally.

Fixed value or expression

The two actions that write a value, set field and set temporary variable, accept that value in two forms, chosen in a selector next to the destination:

  • Fixed value: the content is written exactly as it was typed. Nothing inside it is interpreted: in fixed value mode, $amount writes the text $amount.
  • Expression: the content is interpreted, and what gets written is the result.

Actions created before this option open in Fixed value and keep the previous behavior.

An expression can be:

Form Example
a field of the event $issuer_country
a temporary variable %bot.score
a text, number, or boolean "approved", 10, true
a join with concat concat($order_id, "-", %bot.score_cell)
a part of a text, with split split($user_email, "@", -1)
a set as text, with join join(%bot.triggered_cells, ",")

An action’s expression follows the same syntax as conditions, with one difference: it produces a value, not a true or false, and there are no comparisons or and/or. As in any condition, a temporary variable read in the expression must have been produced by an earlier action.

Compatible types

A text, number, or boolean written directly in the expression is validated by the destination field, exactly as a fixed value would be.

A field, a temporary variable, or a concat, on the other hand, must have a type compatible with the destination. Conversion only happens when nothing is lost:

Destination field type Accepts a value of
Text any type
Integer Integer
Decimal Decimal, Integer
Boolean Boolean
Date and time Date and time

A decimal is not written into an integer field: rounding automatically would decide, on the rule author’s behalf, what to do with the fractional part. The other direction, an integer into a decimal field, is accepted. The result of concat, split, and join is always text, and so it only fits in a text field.

A temporary variable has no destination type. The variable accepts any value, including a set such as %bot.triggered_cells. Copied on its own, the set stays a set and remains usable on the right-hand side of an in. That same set cannot be written into a field, nor used inside a concat. To write it into a text field, convert the set with join.

Absent values

An expression that only copies a value, such as $field or %variable on their own, writes nothing when that value does not exist: the destination field stays as it was, and the temporary variable remains absent. It is the same choice described above, of not replacing absent data with a guess. false, 0, and an empty text, on the other hand, are legitimate readings and are written.

A concat always writes, because it builds new text instead of copying an existing one. Absent parts come in as empty. A split with an out-of-range index and a join of an empty set, on the other hand, write nothing.


Table of contents