Mapped value on table using postgress data

Hi, I have a table on postgres which has 3 columns:

name (text), statuses (text[] - array), numeric_separators (numeric[] - array)

when I query the table and use a table component the data looks different from how it looks on my table. for example:

postgres:
name statuses numeric_separators
a {ACTIVE, PASSIVE} {1,2,3}

retool table component:
name statuses numeric_separators
a ["ACTIVE", "PASSIVE"] ["1","2","3"]

I want to use Mapped Value on statuses and numeric_separators columns (with { item }) to let the values look like my postgres table. I have to do so because the update is failing.
Thanks.

Hello,

Have you tried to use the transformer under the query? you can return formatDataAsArray(data)

@Dorc Hi Dor, thanks for reaching out. You can certainly use mapped value for those columns as you suggest. You can use this script to accomplish the data format that you are looking for:

{{item.replace('[','{').replace(/"/g,'').replace(']','}')}}

The data would then look like this:

Let me know if this works for you or if you have any other questions.