logicalTrigger Documentation
Overview
The logicalTrigger component is a powerful logical gate in the Vantage analytics & data platform. It evaluates a set of conditions against input data in order to control the flow of data through a workflow. The component operates in two distinct modes: filter mode and gate mode, providing flexibility in how data is processed.
Purpose
- To determine whether rows of data should be passed through or blocked based on defined conditions.
- To provide different logical evaluations (AND/OR) for combinations of conditions.
Settings
The logicalTrigger component has the following configurable settings:
Conditions
- Setting Name:
conditions- Input Type: Array of Objects
- Description: An array of condition objects, where each object specifies:
field: The name of the field in the data to evaluate against.operator: The logical operator to use for the evaluation.value: The value to compare the field against.
- Impact: The conditions dictate which rows will be matched. Increasing the number of conditions or adjusting the operators affects how many rows will pass through or be blocked.
- Default Value:
[](an empty array, meaning no conditions applied).
Logic Mode
- Setting Name:
logicMode- Input Type: String
- Description: Determines how multiple conditions are evaluated:
all: All conditions must be satisfied (logical AND).any: Any of the conditions can be satisfied (logical OR).
- Impact: Changing this affects the stringent level of filtering. If set to
all, more rows will likely be filtered out compared toany. - Default Value:
'all'.
Pass Mode
- Setting Name:
passMode- Input Type: String
- Description: Specifies how the output is determined based on the matching conditions:
filter_rows: Pass only the rows that meet the conditions.gate_all: If any row meets the conditions, pass all rows; otherwise return empty.
- Impact: The choice of
passModechanges the flow of data significantly. Infilter_rows, only specific rows are passed, whilegate_allallows all rows to go through if any condition is matched. - Default Value:
'filter_rows'.
Supported Operators
The following operators can be utilized within the conditions setting, each affecting the matching criteria:
equalsnot_equalsgreater_thanless_thangreater_than_or_equalless_than_or_equalcontainsnot_containsstarts_withends_withis_emptyis_not_emptymatches_regex
How It Works
-
Input Handling: The component expects input data to be in an array format. If the input is not in the expected format, it attempts to unwrap it based on existing structures.
-
Condition Evaluation: If there are conditions defined:
- Each row of data is processed against the listed conditions, using the specified
logicMode(AND/OR). - The conditions are evaluated using defined operators to determine matches.
- Each row of data is processed against the listed conditions, using the specified
-
Output Generation: Based on the evaluation:
- If using
filter_rows, only matching rows are included in the output. - If using
gate_all, if any row matches, all rows are passed through; otherwise, an empty result is returned.
- If using
Expected Data
The component expects the input data in the form of an array of objects, where each object contains key-value pairs representing field data, corresponding to the field specified in the conditions.
Use Cases & Examples
Use Cases
-
Data Quality Control: A business needs to ensure that only active users (status = 'active') with account balances exceeding $100 are included in a report.
-
Customer Segmentation: A marketing team wants to segment users who have either been active in the last month or have expressed interest in premium features, to tailor campaigns.
-
Threshold Alerts: An analytics team requires a mechanism to trigger alerts if even a single sale exceeds a predefined threshold for immediate attention.
Example Configuration
Use Case: Data Quality Control
Configuration:
{
"conditions": [
{ "field": "status", "operator": "equals", "value": "active" },
{ "field": "amount", "operator": "greater_than", "value": "100" }
],
"logicMode": "all",
"passMode": "filter_rows"
}In this setup, the logical trigger will check for users whose status is 'active' AND whose amount is greater than 100. It will only pass those users that satisfy both conditions through its output, thus ensuring that the resulting data includes only those meeting the criteria.
AI Integrations & Billing Impacts
AI Integrations
The logicalTrigger may be part of automated workflows using AI-driven data analytics. By leveraging AI, businesses can enhance data evaluation by automatically adjusting conditions based on historical performance or predictive analytics.
Billing Impacts
The use of logicalTrigger may have billing implications depending on the number of rows processed. High volumes of data, especially when used frequently within workflows, may increase processing costs within the Vantage platform. It's recommended to monitor usage analytics for budget management.
This documentation provides a detailed understanding of the logicalTrigger node, ensuring comprehensive insights into its configuration, usage, and operational strategies within the Vantage platform.