I am having difficulty setting the selected value of a multiple select on page load. The value that I want to set comes from database query as “service_name” under an array of “services”.
I could set the selected value if I choose query_user_data.data.services[0].service_name but it only set the first value and not all. query_user_data.data.services gives me [object Object] so that didn’t work either.
I’m not an expert (3-4 month old) but your matter seems familiar.
Can you share screenshots of the API action doing the query and of the component in the App Structure side where you fetch your services dynamic data?
I am not getting what you are trying to accomplish, sorry. Do you want to list an array of ‘services’ or display one specific service on your page?
Could you explain further and/or share the result you see on the page?
Basically I need “ser_name” as an array [‘service a’,‘service b’,‘service c’ ] instead of an array of “services” containing ser_names, if that makes sense.
I managed to get it to work by creating a repeat (referencing “services”) and adding “ser_name” to an array component in a page flow. Then having the selected value of my select2 referencing that array component. I feel like there is a way simpler way though.