Filters

Event filters are conditions written with query syntax based on the event model; they run when the Event API triggers the event. When a payload matches a filter, actions get executed.

onEvent

onEvent filter is the default rule and it is always added to the event at it's creation, which means that all actions associated with it run once the event is triggered.

Query Operators

Filters support the following query operators:

  • >

  • <

  • >=

  • <=

  • <>

  • IN

  • LIKE

Examples

Let's assume the event model:

name: String
email: String
gender: String
subscription:
- id: String
- price: Number
address:
- city: String
- state: String
- country: String

Now we create a new rule called Paying Customer that check if a customer subscription price is greater than zero, this query filter looks like this:

subscription.price > 0.00

Filters also support multiple condition queries, to check if a customer is female and lives in San Francisco the filter will look like this:

gender = "female" AND address.city = "San Francisco"

Conclusion

You can build sophisticated applications using query operators to create complex workflows and execute actions on it. Add new query filters at the event manager pane, and you're all set.