Category: UI Widgets
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Multiselect options in the form keep resetting to blue, green, red

Issue

I am having trouble with a multiselect field in a form on my website. Every time I refresh the page, the options reset to the default colors instead of the custom values I set. I tried using the Appsmith store and storevalue(), but neither worked. However, disabling the auto-generate form option solved the issue.

Resolution

The problem involved a multiselect field in a form generated from a database table, with the options resetting to default after a page refresh. The solution involved using the Appsmith store to track the currently selected value and updating it in the store when it changes. This ensures that the custom values are retained even after a refresh.

However, it was noted that using the storevalue() function didn't help, and instead, disabling the auto-generate form option was the key to solving the issue. This prevented the options in the multiselect field from disappearing and resetting to default.

Overall, the solution involved a combination of using the Appsmith store and disabling the auto-generate form option, depending on the specific requirements and circumstances of the project. Code examples were not provided in the original question or answer.