Difficulty setting selected value of multiple select

Hello,

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 am using select2, if that’s relevant.

Community Page
Last updated: