Category: Appsmith Support
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.

Issue with Select Default Value

Issue

I'm having trouble using a Boolean value as a default value in a Select widget. The evaluated value of the JS input is true, but I get an error saying the value does not evaluate to the correct type. I've tried using quotes around the input and manually inputting true, but neither works. I received a solution to use code in the Default Value instead.

Resolution

The user was experiencing an issue when trying to use a Boolean value as a default value in a Select widget in Appsmith. The evaluated value of the JS input was true, but they were getting an error saying the value does not evaluate to the correct type.

The solution was to use a JSON object with a label and value property instead of a Boolean value in the Default Value field. They used the following code in the Default Value:
{
"label": "{{Table__PSH_Objects.triggeredRow.TRACK_CHANGES}}",
"value": "{{Table__PSH_Objects.triggeredRow.TRACK_CHANGES}}"
}

This resolved the issue and the Select widget worked as intended. The user was also informed of a known bug related to this issue, which they could track on GitHub.