27 Commits
Author SHA1 Message Date
Davide Silvestri c3958f264b feat (database): first and last formulas (#5066)
* feat: add first(), last() and generalized index() formula functions

* fix: address PR review feedback and handle NaN index argument

- Rename _BaserowIndexShortcut to BaserowIndexShortcut (drop leading _)
- Remove unnecessary comments and section separators
- Rename variable c to clone in JSONBArrayGetElement
- Rename test to test_first_and_last_return_scalar_values, drop docstring
- Remove step comments in test_index_generalized.py
- Handle NaN/div-by-zero as index() argument (returns null instead of crash)

* feat: update index() formula examples to include array fields
2026-04-03 07:47:21 +00:00
Davide Silvestri ee1371ff55 feat (database): array_slice formula (#5062)
* feat: add array_slice() database formula function

* fix(formula): handle NaN arguments in array_slice to prevent DB crash

Wrap start/count args with handle_arg_being_nan before truncating to
int, so expressions like tonumber('x') no longer cause
"cannot convert NaN to integer" at the PostgreSQL level.
NaN is treated as 0 for both arguments.
2026-04-03 09:10:16 +02:00
Davide Silvestri 3670bf42c1 feat (database): add array_unique db formula function (#2326) (#5056)
* feat: add ARRAYUNIQUE() database formula function (#2326)

Add array_unique() formula that removes duplicate values from lookup
arrays, preserving first-occurrence order. Mirrors Airtable's
ARRAYUNIQUE() — operates on true arrays from lookup fields, not plain
text.

Supports text, number, boolean, date, duration, URL, email, phone,
rating, single select, multiple select, link row, created_on, and
autonumber sub-types. Rejects file fields (different JSONB structure).

* feat: enable count() and join() composability with array_unique()

Add internal non-aggregate functions (array_length, array_join_values)
that operate on JSONB arrays directly, and wire them into count() and
join() so that count(array_unique(...)) and join(array_unique(...), sep)
work. The existing many-expression paths remain unchanged.

* docs: add array_unique to formula docs, mark internals as exceptions

Add array_unique to formula_docs.md so the formula prompt completeness
tests pass. Add array_length and array_join_values (internal delegation
targets) to the formula_exceptions lists in both test files.

* chore: ensure tests works also for formulas referencing different field types
2026-04-03 08:43:12 +02:00
716d43a9a8 Nuxt 3 migration (#4342)
Update the nuxt3 version.

Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
Co-authored-by: Cezary <cezary@baserow.io>
Co-authored-by: Tsering Paljor <tsering@baserow.io>
Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io>
Co-authored-by: Bram <bram2w@users.noreply.github.com>
2026-01-22 10:27:19 +01:00
Przemyslaw Kukulski 19a84d4c5d Resolve "Add tourl formula to support operations on url field type" 2024-08-01 19:50:43 +00:00
Davide Silvestri 339ba10c04 Re-enable rollup functions for all field types 2024-05-29 08:41:07 +00:00
Davide Silvestri aeb4ff6684 Draft: Resolve "Support for division/multiplication/tonumber formula for duration field" 2024-05-08 09:21:55 +00:00
Davide Silvestri dbb847f88d Add && and || operators to the formula language 2024-04-10 07:51:40 +00:00
Davide Silvestri 0c563352c8 Resolve "Button formula function should show as an actual button" 2024-01-03 08:58:31 +00:00
Davide Silvestri 1a90b6e2fe Resolve "Support multiple select in the formula field" 2023-12-11 09:33:58 +00:00
Nigel Gott d704b560ca Resolve "Lookup field compatibility with the file field" 2023-10-11 10:35:54 +00:00
Eimantas Stonys a463434061 Resolve "Add split_part formula function" 2023-09-13 08:44:05 +00:00
Sabeeh Hassan 03466721f8 Resolve "Add formula function to encode uri's" 2023-08-02 10:05:10 +00:00
Jérémie Pardou 3072524b31 Allow date type for min and max formula functions 2023-07-04 13:59:30 +00:00
Bram Wiepjes cdf35c9554 Resolve "Rollup field" 2023-06-12 08:57:19 +00:00
Davide Silvestri 1d5c830729 Resolve "Formula's totext function doesn't take into account timezones for date fields" 2023-05-15 13:56:44 +00:00
Davide Silvestri 86d1e29202 Resolve "Add the now() formula" 2023-03-08 10:34:59 +00:00
Davide Silvestri bfd78ee23c Resolve "Introducing nullables for formula: fix isblank(); add isnull() function" 2023-03-02 17:59:35 +00:00
Alexander Haller c1cfdb235b Resolve "isNan/whenNan formulas" 2023-02-02 16:11:55 +00:00
Davide Silvestri e898953f63 Resolve "Add missing Maths formula function" 2022-12-20 08:39:44 +00:00
Nigel Gott 5dc6ca9971 Resolve "[Feature] Add URL formula keyword" 2022-09-20 08:51:55 +00:00
Nigel Gott 298faf1760 Fix divide function sometimes resulting in errors and fix up and make available round and int functions 2022-08-29 17:11:38 +00:00
Nigel Gott bbd8e58629 🧠 FInal Formula MR 2022-06-28 16:29:56 +00:00
Zuhair Rayyes d819567153 Formula field translations 2022-01-12 09:31:01 +00:00
Nigel Gott a66653b9f1 Resolve "Disable repeat formula function for now" 2021-11-24 13:45:20 +00:00
Nigel Gott 41b134793f Lookupfield 2021-11-24 10:53:00 +00:00
Nigel Gott a943716dde Final formula MR 2021-10-05 11:31:44 +00:00