Formatting Help

Hello,

I am hoping you can assist me with a small issue. I have a table in my RetoolDB and I have a column where the row string is as follows:

["K071126","K071127","K071128"]

I need to query that string in my app and display it as an array so that the "item list" component picks it up. I am having trouble formatting it as an array.

Any help would be greatly appreciated.

Thanks,

Hey @Miotx, you could enable Transform results on the query, and add to it:

return JSON.parse(data)

Hi,

Thanks for your reply. I tried that but didn't get any result unfortunately,

Thanks,

You could alternatively try JSON.parse(query1.data) as the data source input

Unfortunately, still nothing.

Thanks,

I can see that the transformer is missing a return in that last screenshot but I think the issue might be that you need to specify that it's the first record, so the data source for the multiselect may need to be something like {{ JSON.parse(query1.data[0]) }}

1 Like

I tried that too but its all red and didn't return anything.

Thanks,

Try this:
JSON.parse(formatDataAsArray(data)[0].store)

Hi Mitch!

Still nothing unfortunately.

Thank you,

Here is without the transformer what the response looks like:

Maybe this?

return JSON.parse(Object.values(formatDataAsArray(data)[0])[0])

2 Likes

Worked like a charm!! thank you so much!!

1 Like