CollectionsCollections Database

Add formulas to a view

You can add formulas to a view to build advanced filters.

The formula must return YES (Boolean value) if the condition is satisfied, otherwise NO (Boolean value).

Filter by the current day

In the following example we'll add a formula to filter the documents that match the current day only.

Add formulas to view

Open a collection and tap on the button → Select New view.

Add formulas to view

Tap on the button to add a new condition.

Add formulas to view

Tap on the Date field.

Add formulas to view

In the condition, tap on the operator → Select Formula.

Add formulas to view

In the condition, tap on Any.

Add formulas to view

Tap on the button in the formula editor.

Add formulas to view

Tap on the Date in unit function. This function checks that a date is included in a specified range.

Add formulas to view

Tap on the button in the formula.

Add formulas to view

Tap on the Date field.

Add formulas to view

Formula is completed, tap on the Save button. Tip: you can also filter by month or year just by changing the second parameter of the function.

Add formulas to view

Tap on Save this view to save the view.