Take the community feedback survey now.

SelectOne Fields Fail To Display Numbers As Strings In Editor

Vote:
 

The editor view fails to load the stored value of a property that has a [SelectOne] attribute when the options value is a number as string ("1", "2", "3", etc). Selections are stored correctly on save/publish but the JS framework fails to load and display the selection

#340996
Nov 13, 2025 13:14
Eric Herlitz - Nov 13, 2025 13:16
Reference to dialog on Slack: https://optimizely-community.slack.com/archives/C01UW3RT8KC/p1762791865338799
Vote:
 

Hi Sammyender, 
This looks like an issue with how the Optimizely editor handles [SelectOne] options when the value is a numeric string (e.g., "1", "2", "3").

The value is saved correctly to the database, but when the editor reloads, the UI-side selection component fails to match the stored value with the list of options — which is why the dropdown shows as unselected.

This is a known limitation with the current implementation of SelectOne.

 

Here are a few reliable approaches until the UI handling is updated:

1. Use non-numeric string values
Instead of "1" / "2" / "3", use "Option1" / "Option2" or meaningful codes.
These bind correctly and the editor displays the selected value without issues.

2. Use an enum with [SelectOne] or BackingType = typeof(string)
Enums avoid the value-type mismatch and work well with selection editors.

3. Prefix numbers to keep them purely string values
Example: "v1", "v2", "v3"
This also prevents the framework from interpreting the value as a number.

Thanks,

#341095
Nov 26, 2025 8:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.