Skip to content

Resolve "Introducing nullables for formula: fix isblank(); add isnull() function"

Merge Request Checklist

  • changelog.md has been updated if required
  • New/updated Premium features are separated correctly in the premium folder
  • The latest Chrome and Firefox have been used to test any new frontend features
  • Documentation has been updated
  • Quality Standards are met
  • Performance: tables are still fast with 100k+ rows, 100+ field tables
  • The redoc API pages have been updated for any REST API changes
  • Our custom API docs are updated for changes to endpoints accessed via api tokens
  • The UI/UX has been updated following UI Style Guide

Closes #996 (closed)

This MR introduces the concept of nullable_args and a placeholder_empty_baserow_expression. This is the case, for example, of most of the field columns in a table.

In the case of the isblank function, these new concepts permit the function to behave slightly differently based on the argument types, without the need of always Coalesce(arg, 0) for numbers in order to make all the mathematical and aggregation function work the same as before.

In particular, returning a literal(0) for the placeholder_empty_baserow_expression of the BaserowFormulaNumberType, we can check if the number is either None or 0, making the isblank work the same as Excel, Airtable and other spreadsheet sw.

The very same concept can be apply also to date_intervals so that a formula like date_field + date_interval will return a date even for an empty (None) date in the date_field.

Edited by Davide Silvestri

Merge request reports