Data Change Alerts

Summary

  • The most common type of Alerts in AdapTable are those which fire as the result of a Data Change rule
  • This Data Change rule can be one of 2 types:
    • A Predicate - fires when the cell change matches the predicate
    • A Boolean Expression - allows for multiple cell values to be included in the evaluation

Data Change Alerts are the most common type of Alert in AdapTable.

They fire whenever a change in the Grid's data matches the Rule in the Alert Definition.

Note

This change can be either the result of a user's edit or of ticking data

The Rule can be one of two types:

Predicate

Predicates are used for more "simple" Data Change based Alert rules.

Note

A Predicate is a boolean function used in many places in AdapTable (e.g. Column Filters)

Predicates have a type (e.g. GreaterThan, Positive) and optional inputs if required (e.g. 100).

Find Out More

See the System Predicate Guide for a list of all the System Predicates available for Alerts

The Alert fires if the Data Change matches that defined in the Predicate.

Alerts: Triggered by Predicates
Fork
  • This Demo contains 4 Alerts that each uses a Predicate-based Rule for reacting to Data Changes:
    • LessThan Predicate (on the GitHub Stars Column) - the Alert fires if the value is less than 1000
    • GreaterThan Predicate (on the Open Issues Column) - the Alert fires if the value is greater than 500
    • Blank Predicate (on all String Columns) - the Alert fires if the new cell value in any string Column is empty
    • Is Predicate (on the Name Column) - the Alert fires if the Name is changed to "Python"
  • Each Alert will display a Notification and has a Behaviour of highlighting the cell

Expand to see the Predicate Definitions

Try It Out
  • Trigger Alerts by:
    • Editing a cell in the GitHub Stars Column to a value <1000
    • Editing a cell in the Open Issues Column to a value >500
    • Changing a value in Language, Name or Description Columns to a blank value
    • Changing a value in the Name Column to "Python"

Multiple Predicates

Prior to Version 14 only a single Predicate could be supplied for each Data Change Alert.

There is now no limit on how many Predicates can be provided in each Alert Rule.

This allows for a more powerful and flexibile rules to be set.

Hint

It allows users to use Predicates in preference to more complicated (and sometimes off-putting) Expressions

Alerts: Multiple Predicates
Fork
  • This Demo contains 2 Alerts that each contain Multiple Predicates in the Rule which reacts to Data Changes:
    • GitHub Stars Column - Alert fires if new value matches Predicates GreaterThan 100 and LessThan 1000
    • Name Column - Alert fires if new value matches Predicates StartsWith 'A' and EndsWith 'Z'
  • Each Alert will display a Notification and has a Behaviour of highlighting the cell
Try It Out
  • Trigger Alerts by:
    • Editing a cell in the GitHub Stars Column between 100 and 1000
    • Changing a cell in Name Column to a new value which starts with 'A' and ends with 'Z'

Boolean Expression

For more advanced scenarios, Alerts can be triggered as the result of a Standard Expression.

AdapTabble will use AdapTableQL - its native Query Language - to evaluate the Expression.

Note

This enables Alerts which will fire based not just on data changes in the changed cell, but other values in the row

If all (the potentially complex) conditions return true, the Alert will fire.

Hint

  • An Expression with a Scope of All (i.e. the whole row) is evaluated whenever any cell in the row is edited
  • However, specifying a limited Scope of a few ColumnIds will restrict the edits that potentially trigger the Alert
Alerts: Boolean Expressions
Fork
  • This example fires a Success Alert when as a result of data changes in the row, Github Stars has an even number and the Language is TypeScript
  • The Boolean Expression provided is [github_stars] % 2 = 0 AND [language] = "TypeScript"
Try It Out
  • Edit the GitHub Stars in a row where language=TypeScript to be an even number
  • Edit any cell in a row where language=TypeScript and an even number of GitHub Stars

Find Out More

The AdapTableQL Guide provides full details on writing Boolean Expressions