Cannot set value of Select component nor set default value

  • Goal:

I tried setting the default value of my Select component to multiple things, even a basic string, and it does not make it the default value for the Select component. I even wrote a basic JS Query to update the value of the Select component and it will not update the select component value with anything, even a simple string "Hello".

  • Steps:

Aside from what I mentioned above, I made a brand new Select component that has the default Option 1, Option 2 and Option 3 options. I couldn't set any default value unless I wrote it either Option 1, Option 2 and Option 3. I tried to recreate this with my main Select Component, which presents string inputs from an array I'm calling, and it would still not take any string as its default value.

  • Details:

Using most recent version of Retool.

Simplest use case - the default value is a string that exactly matches one of the manually entered Options (the default is "Option 2" and that's what the select shows)
image

Dynamic simple option - I have a simple JSON array and I use JS to pull a string (the 0 index value in the array is "Option 3" and that is what the Select shows - I put the options out of order just to try to show it is dynamic)
image

Dynamic mapped option - my options are now mapped to another JSON, but still works just fine (the 0th value is "Option 3" which gets selected (note: not "option 3" with lower case):

Dynamic mapped option with labels - you can set value and labels to be different arrays with an object used as a data source for your drop down. It still seems to work fine (the value at index 1 in my array is 4, which maps to index 3 of my mapping values, and index 3 of my label values is "monkey" which is what is shown):

Does one of these help with your situation?

1 Like