Default value not showing associated label

I have a select in my app that have a default value : {{scaninventory.data.LocationID[0]}} (null until a user enter a value)
image
Not sure when It broke but before we where seing the Label and not the ID.
Now It shows the ID instead of the label.

If I select the ID 32 in the dropdown it shows the label, but if I use the default value to input the 32 it doesn't show the label associated.

Is it possible that the default is a number in String format and the ID needs to be a number?

The ID needs to be a number yes, but i'm not sure still how to make it work again :sweat_smile:

It says that the value has to be a string
image

You can use {{ String(scaninventory.data.LocationID[0) }} to make it a string.

Thank you It is working !!!

1 Like

Do you think it is possible to remove the undefined that is showing ? (be empty instead)

Using the ternary {{ scaninventory.data.LocationID[0] == undefined ? '' : String(scaninventory.data.LocationID[0]) }} should work. You can change it to display some other text besides an empty string, like 'Nothing selected'.