Multiple options - Retool Database

Is there a way to convert the data seen in the image to multiple options in the cell. I want them to be multiselect options but I am not sure if this is possible or if i am using the wrong operator

HI there @Andrew_Parkinson. Welcome to the forum!

It is definitely doable with a simple split javascript function.

For example, within your multiselect component, you can reference your query in your the data set with something like {{query1.data[0].tech_stack_combined.split(',')}}

This one-liner takes the value of the variable , which presumably holds your string, and then splits it into an array using the comma , as the separator.

Does that make sense?

Ofcourse I'm using the [0] index for demonstratino purposes, but you'll fneed to adapt as per your app design

Hi @MiguelOrtiz

Thanks for this.

@MiguelOrtiz I am trying to get the data in database to be like this. This is an example from airtable

1 Like

@Andrew_Parkinson those look like Tags, which are table column data type you can select in Inspector. as long as you have multiple values like Miguel said

1 Like

Indeed, thanks @trz-justin-dev.

So the steps are:
1- Add your query's results to your table's data source
2- you will have a tech_stack_combined column which most likely will appear as text type by default
3- Change the type to Tags
4- In the field "Mapped value" you can write {{item.split(',')}}

I think this should be enough for it to work!