Rules

LeadConduit uses a rules engine to customize flow behavior based on field data, appended data, or internal tracking metadata (such as the submission timestamp). The rules engine is built into flow acceptance criteria, filtering, volume caps, pricing, mappings, and more.

Rule Set

Rules belong to a set which has the following properties:

  • opand or or determines whether all rules in set must pass or just one
  • rules — the array of Rules and/or Rule Sets to evaluate

Rules

Each element of the rules array can be a Rule or another Rule Set.

Rules have the following properties:

  • lhv — left hand value is a key to look up a value from the lead data context
  • op — operator Name of the operator
  • rhv — right hand value (omit for unary operators like is blank)
  • rule_set — optional rule set to be ANDed with the rule

Variables

When rules are processed the lhv will be resolved to a value using the data in the variables found under that key. For example, if the lhv is "lead.first_name" and the variables are { "lead": { "first_name": "Bob" } }, then the resolved lhv will be "Bob".

Templating

The lhv and rhv of each rule supports (templating)[/#tag/Templates]. The variables are used to evaluate the template.

Rule

One of:
id
string (ShortID) ^[0-9a-zA-Z]{6}$

ID for this rule

lhv
required
string

The required left-hand value to be evaluated (templating is supported)

op
required
string

Binary operators compare the lhv and the rhv.

Enum: Description
is equal to

Is the string (case-insensitive), number, or range lhv equal to the rhv?

is not equal to

Inverse of the is equal to operator.

is less than

Is the numeric or range average lhv numerically less than the rhv?

is less than or equal to

Is the numeric or range average lhv numerically less than or equal to the rhv?

is greater than

Is the numeric or range average lhv numerically more than the rhv?

is greater than or equal to

Is the numeric or range average lhv numerically more than or equal to the rhv?

is between

Is the numeric or range average lhv between the rhv range min and max (inclusive)?

is not between

Is the numeric or range average lhv outside the rhv range min and max (exclusive)?

is included in

Is the string, number, or boolean lhv included in the Array of values provided in the rhv?

is not included in

Is the string, number, or boolean lhv missing from the Array of values provided in the rhv?

includes

Does the Array of strings, numbers, or booleans provided in the lhv contain the rhv?

does not include

Is the Array of strings, numbers, or booleans provided in the lhv missing the rhv?

rhv
required
Array of strings or numbers or booleans or arrays or string or number or boolean

The right-hand value to be evaluated (templating is supported)

object or null (rule-set)

A rule set is a collection of rules to evaluate. The op property determines whether all rules must pass (and) or just one of them must pass (or) in order for the rule set to be considered passing.

{
  • "id": "1aacd0",
  • "lhv": "lead.state",
  • "op": "is equal to",
  • "rhv": "TX",
  • "rule_set": {
    • "id": "1aacd0",
    • "op": "and",
    • "rules": [
      • {
        • "id": "1aacd0",
        • "lhv": "lead.state",
        • "op": "is equal to",
        • "rhv": "TX",
        • "rule_set": null
        }
      ]
    }
}

Rule Set

A rule set is a collection of rules to evaluate. The op property determines whether all rules must pass (and) or just one of them must pass (or) in order for the rule set to be considered passing.

id
string (ShortID) ^[0-9a-zA-Z]{6}$

The ID of the rule set in this flow

op
required
string

Determines whether all rules or just some rules must pass for the overall set to pass

Enum: Description
and

All rules in the set must pass

or

Only one rule in the set must pass

required
Array of Binary Rule (object) or Unary Rule (object) or (Rule Set (object or null)) non-empty

The required rules to be evaluated. Rule sets may also be specified as array elements in order to achieve nesting.

{
  • "id": "1aacd0",
  • "op": "and",
  • "rules": [
    • {
      • "id": "1aacd0",
      • "lhv": "lead.state",
      • "op": "is equal to",
      • "rhv": "TX",
      • "rule_set": { }
      }
    ]
}