In my app I am displaying a “Region”. Here the user can update the name and the HQ location of that region. In Xano I have a database table of “companies” and a “regions” table. Each region has a company set as the HQ location.
In WeWeb I have a dropdown with a dynamic list of options coming from a database table “companies” in Xano.
Now I would like to set the initial value of this dropdown to the company that is set as the HQ location of this Region.
I’ve tried 100 different things but I couldn’t figure this out. Any advice on how to set the initial value correctly if you have a dynamic dropdown with data coming from Xano?
In the field initial value you put the same id, that matches your desired preselected item, from the items that is plugged into the dynamic options. (Bwcause your ids are the values)
I think what you need to do, is do “On Change” → “Change variable value - to the event value” (of your premade variable) → Bind the variable to the init value
your value it’s a number, the error says that is expecting a string. Eventually the value will be implicitly converted to string. You can add an explicit conversion, for example by wrapping it like this String(YourValue)
I think that wouldn’t match the 0 in the select [‘id’] value, would it? I’m not sure whether it is a string at the end or nay. I remember that kanban had a problem with this, when you set “0” to the stack and 0 to the identifier.