How to access JSONB object data for table display?

I’m storing JSON in a JSONB field. It doesn’t look like I’m able to expand the “data” field to see the structure within it. How can I specify a key within the data object to place in a table?

image

JSON or JSONB works all the same see:

The provided guide doesn’t appear to go over object data types, only array data types.

The API schema is able to understand the data object and nested structure.

But after adding the json to a jsonb column and querying it with server connect to add to a page, I do not get the same nested structure out of Server Connect.

image

@George is this something that needs to be enhanced in Wappler to work?

When using JSON fields in a database you just have to define their schema in the database manager as explained in the article above.

Than it will be pickable.

Where can I define its schema? The UI properties section does not have anything of value when the Data Type of the field is Object.

image

Also the data being stored in the JSON field can vary from record to record. There’s no defined structure to it.

For example,

Here’s the traits from record 1.

Here’s the traits from record 2.

Here’s trait from record 3.

If you want the data field to be pickable you will have to define schema for the json data field. Just choose it as type object and add schema under it via the context menu.

If you have different json objects in each record than you will have to code those manually. But generally this is a very bad practice.

Unfortunately that’s the way the data come from the API. I’ll see if I can find someone to develop a way to consume it on my page.

@George or @Teodor

If I have defined JSON choices in UI Properties. Should these show the choices show in data bindings? Right now, I do not see them below the checkboxes in Data Bindings

Database settings

Data bindings
image