What is a Trigger?

When you're using an Output Connector to send out data you need to tell the RLD system when to trigger a data output. This trigger can be time based or can fire based on some condition, allowing you to regularly send out data or only send when necessary.

Note: The trigger system is available for all Output Connectors except the 'httppull' type.

Trigger Terminology

Field - An RLD field, either a raw field from your data or a calculated field

Trigger Query - The field that determines whether to fire the trigger

Data Constraint - The field that constrains output of the trigger

Trigger Type - Either 'realtime' or 'timed'. This determines how your query is checked

Output Mode - Either 'last', 'all', or 'trigger'. It determines which or how many records are sent out by the trigger

Understanding "True" Values

When using the RLD trigger system, the concept of "True" is important to understand. It's also important to keep in mind that throughout the wiki and product the terms 'not null' and 'true' may be used interchangeably.

Examples of a "True" or "Not Null" Value

What is a "False" or "Null" Value

Introduction

The trigger system is a feature available to all Output Connectors (outcons) except the 'httppull' Output Connector. The trigger system allows you to react to changes in your database and perform actions based on the data (send an sms, send an http request, etc.).

The trigger system is divided into 2 parts:

  1. The Trigger
    • Determines when and how the outcon is actually fired
  2. The output
    • Determines what data or message is sent.

Note the distinction between trigger and output. The RLD trigger system detaches the trigger with the data query that is sent out. You can configure the trigger system by creating a new outcon.

Trigger Tab

This is the TRIGGER tab, this is where you control what triggers this outcon.

Trigger Tab

There are three modes of operation:

1. Timed Trigger

This is the simplest form of trigger. A timed trigger will fire on the
interval specified. Time triggers can be very useful for syncing your data
to an external source, or to send periodic updates about your database.

Timed Trigger

2. Realtime Trigger

Realtime triggers are event-driven. To create a realtime trigger you must
first drop a field into the 'Trigger When... is True' box. We'll call this
field the 'trigger query'. The way the trigger system works is that everytime
a record comes into this outcon's dataset, the trigger system will check to
see if the trigger query is "True". If it isn't the outcon will be triggered.

Realtime Trigger

3. Timed + Realtime Trigger

This type of trigger is useful for periodic updates where you don't want to do
anything if nothing changed. To create a timed + realtime trigger, you need to
drop a field into the 'Trigger When... is True' box and select the 'Timed'
mode. A timed + realtime trigger works by checking if the trigger query is
"True" on the time interval specified.

Timed + Realtime Trigger

Data Output Configuration

Data Tab

This is where you control what data is sent after your output connector is triggered.

It's important to note that the RLD system allows you to detach the
trigger portion with the data portion. In other words, the data you output
doesn't have to be correlated with the data that caused the outcon to trigger.

Data Constraints

"Only consider records where ____ is TRUE"

You can optionally drag a field into the box
Doing so will constrain the records you send out to records where the dragged
in field is "True". This can be used to limit what data you send out. This field
is called the data constraint.

Output Modes

"Select Records to Include"

This radio box lets you select what records you want to output. This is called
the output mode. Here you have 3 options:

Last Record

This will output a single record that is the last record from your database. This
takes into account your data constraint, so if you have one, it's like saying
"give me the last record where _ is TRUE".

All Records

This will output all records from your database where the data constraint is
true. It's like saying "give me all the records where _ is TRUE".

Trigger Record

This mode will only be visible if you select 'Realtime' as the mode in the trigger tab. This mode allows you to correlate data that is sent out with the trigger itself. It only sends one record, but it is guaranteed to be the record that caused the trigger to happen. If you happen to have a data constraint, it'll only send a record if the data constraint was not null for the record that caused the trigger. It's like saying "give me the record that caused the trigger if and only if it also satisfies the data constraint."

Important: Keep in mind that for all outcons, if after triggering and fetching data, the final result has only 0 records, the outcon won't send anything.