Formula field
Issue Plan
MR Group 1
These issues will be opened as separate MRs into a Final MR to be merged into develop as a group:
- #586 (closed) Add basic text formulas
- Add support for:
- Text concat operator
- referencing other text fields (the field function)
- Can't reference unsupported field types (anything but text fields to start with)
- referencing other formula fields
- Can't do circular or self references
- When a referenced formula field is updated, needs to update the nested formulas in all dependant fields and trigger a data update for all users in realtime
- numeric type and related functions
- This being the second type, type checking needs to be added, functions need to have argument and return types, these need to be evaluated and checked if allowed
- Add type casting functions
- Must ensure that casting failures don't turn into actual database errors but instead just mark the cell as in an ERROR state
- extract functions, maybe operators etc into registries
- boolean type and related functions (case, IF, etc)
- date type and related functions
- add record types/functions (ROW_ID, LAST_MODIFIED_AT etc)
- Add the autocompleting/resizing/doc providing formula editor
MR Group 2
These are extra features which are not required for the v1 release and will be grouped into a separate final MRs.
- Add as you type formula errors/warnings from the backend
- Add frontend type checking
- Add frontend validation
- Add frontend interpreter for text only formulas
Future Features not yet grouped/prioritized
- Add per type specific formula field formatting. E.g. you can say output this field in this datetime format if the formula is of a datetime type etc.
- Formula fields in form views
- Could let users create dynamic feedback in forms if formula fields updated in realtime/quick enough and were shown in the form view in a read only fashion
- Could let users create custom validation logic for forms by marking a boolean formula field as "required" meaning that the form could only be submitted if and only if that formula field evaluates to true
- Importing other formula languages
- Hopefully in most cases this will be a trivial function name mapping, but i'm sure there will be a ton of edge cases and oddities
Edited by Nigel Gott