Support JSON (Objects) as a Field Type
Feature description
It would be great to be able to store JSON values (Objects, but also JSON arrays) in fields.
This was also raised by mahmouds12 on the discourse platform: https://community.baserow.io/t/field-of-type-json-with-formatting/1160
I think that even with minimal UI support (e.g. no Form integration, only monospaced JSON display) this could add great value:
By support JSON directly as a datatype, PostgreSQL's first-class JSON field support can be surfaced to users and plug-in developers. The Django JSONField
can serve as a foundation for Plugins to store more complex values in a single field.
For example, this would allow import JSON data directly into JSON-fields which a plugin can then access to enable a lot of functionality.
This would also open up a feasible workaround and development path for #1239:
- User imports JSON file; top-level fields get broken into "JSON" or "Text" fields (depending on JSON-type)
- If a JSON-value is an array of strings, the user can change the field type using the "Edit Field" UI.
- A field converter can match on "from JSON to multiple select" and convert a JSON Array value appropriately.
Examples
PostgreSQL's JSON support in itself is a kind of example for this.