I am a new to retool. I am making an app connected to supabase. I have a table- (see screenshot) that has a column Requirements Level. I want to make it a Dropdown and populate it from an enum. I have a resource [requirement_levels_enum] that provides the enum values. I want the Dropdown to contain these values. Also, I want the selected value to be determined by the resource [fields_to_display] which provides the data for the table. I am not sure how to change my text column to a drop down and populate from the enum resource. Lastly, if the user selects a ne vaue I want to save it to the db,
Hey @David_G, welcome to the forum!
You can use the tag type column, I made a tutorial on this which you can watch here https://youtu.be/fhm0fAmBAuU
With regards to allowing users to select a new value, you can enable the "Allow custom values" option so that the user can type a new value.
Hope this helps
Hi Miguel. Thank you. I watched video but am still a bit lost. I managed to map my Requirement Level Column to my enum successfully. But the values don't actually appear in the table.
When i click on the mapped value field i get this which seems to indicate the mapping is correct.
Mapped Array(6)
[{ "requirement_level": [ "Required", "Regular", "Optional" ] },{ "requirement_level": [ "Required", "Regular", "Optional" ] },{ "requirement_level": [ "Required", "Regular", "Optional" ] }, ...]
This is a screenshot:
Hey @David_G,
So you are using the "Mapped value" field rather than the "Option list".
The mapped value field will actually replace the values being taken from your data source. What you want to use is the Option list, and use requirement_levels_enum.data as the data source for that. Based on the data you shared, you can use {{ item.requirement_level }} in both value and label of the mapped options, something like this:
HI @MiguelOrtiz
I think I'm getting closer, thnks to your help.
As you can see in my first screen shot, I have an error in my option list
In my second screen shot there is a difference from what you suggested as a data source and what I am using. You seem to be hardcoding the values, but I want them to come from my resource requirement_level which you can see (on the left is providing 3 options (Required, Regular, Optional). At the bottom right there is a notice that I don't understand).
Needless to say, it is still not working
Hi @MiguelOrtiz
I finally got it to work, thanks to you.
The final action that got it work was defining the data source as
{{requirement_level.data}}
Thank you for your help.
Glad I was able to help! Good luck with your project!