Skip to main content

has_descendant

Synopsis

@has_descendant(Expression) -> Boolean

Description

Checks if the object has a descendant matching the provided logical expression. This function is similar to @has_child(), except the sub-objects matched by the expression don't need to be direct children.

info

Available in Contextal Platform 1.0 and later.

Parameters

A logical expression, which should match for the descendant object.

Return value

Boolean: true if there exists a descendant object matching the logical expression, false otherwise.

Examples

object_type == 'Email' && @has_descendant(object_type == "PE")
  • This matches Email objects with PE objects embedded somewhere in their structure.