Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Looking for

Status
colourBlue
titleCLOUD
documentation?  This page has information that is valid for both versions

Filters / Conditions


Info

Filters is a very important concept in ConfiForms and is used in many places, basically it is the core of ConfiForms, a base which helps to connect ConfiForms forms and allows to query data stored within ConfiForms form:

  • to limit number of records returned by "*views" macros (TableView, ListView, CardView, CalendarView and ValueView)
  • to fire IFTTT actions based on conditions (ConfiForms IFTTT macro)
  • to execute rules based on a condition (ConfiForms Field Definition Rules)
  • to define custom CSS rules for your views, conditionally

...

ConfiForms plugin uses 'Lucene like' syntax for expressions, supports grouping using parenthesis and AND/OR logical operators. Nesting expressions is possible

Supports filtering for expressions that start with a wild-card. Supports filtering per field as well as free text search (filter to match against any field value).

Operators AND and OR are case-sensitive! (as everything else in ConfiForms: field names, form names, virtual functions)

Supports not notation, to filter records that do not match the given filter: '!' is used for that. Example: !f1:[empty] - will look for records where f1 field value is not empty (has some value)

Supports simple math operations and comparisons on dates (to add or substract days from today's date). See examples below 

Valid example: (f1:*success AND f2:>[yesterday]) OR (f3:accepted) - matches records with field values having 'success' and where f2 field value is after yesterday or where f3 filed value is equals to 'accepted'

Valid example: (f1:*success AND f2:>[today]-1) OR (!f3:[empty]) - matches records with field values having 'success' and where f2 field value is after yesterday or where f3 field value is not empty

Through "evaluateFormula" from Virtual functions you have access to Supported math operators, formulas and functions


Main principle is you match current record's field's value with a given value

Code Block
fieldname:value

where fieldname itself could be an expression and value could be a reference to field values via [entry.field_name] notation

Code Block
fieldname.trunc(3):[entry.anotherfield.trunc(3)]

Important to follow the concept of a field name followed by a value to check against separated with :


To match values against regular expressions please consider using "matches" function from Virtual functions

Code Block
myfield.matches(^[a-zA-Z0-9]*$):true


Reserved words to use in expressions:

...