Custom Column using a property in a JSON field?

How do i create a Custom Column where the value is derived from a property of a JSON field?

I think the issue i'm having is that this particular JSON field is not getting destructured. How to do that?

What do you mean by destructured? There is a setting Allow JSON unfolding at database level Admin -> Databases are you looking for that? It will turn each key into separate columns

@TonyC

what do you mean by still nothing? can you share a screenshot of the resulting table? Note that Metabase gets the schema by scanning the first 5000 rows ... so if your rows are {} you will simply end up with empty ... cant you create the same pattern you have for the last entries.

like:

{"onLine":0, "languages": "", "connection": "", "displayMode": "", ...




After re-syncing schema and re-scanning field values:

instead of {} can you try defining the json pattern but empty ... like i suggested above:

{"onLine":0, "languages": "", "connection": "", "displayMode": "", ...

Till what level of nesting?
The incoming data's schema is dynamic as well.

This worked, for now. Thanks!

But had to replace a lot of values, with an object whose schema might not match all the other values.

What would be the recommendation for a dynamic schema?

the metabase scans the first 1000 values to understand your schema so if the json is dynamic then you will have a problem. The best way would be to create a view at DB level and split the key, value pairs in the view itself

Also, not all of the nested properties got unfolded.
Some did, some didn't.

Does something else need to be done, to make the new schema appear in the existing models?
I'm trying to Edit Metadata for an existing model, to include new columns, but it doesn't show them.

Which metabase version are you running? The model should update ... try to rerun the model query definition and see what you get

Hi @TonyC
I have the same issue :frowning:
Anyway we can increase the limit of rows scanned by metabase before understanding the schema?
Thanks