Hello, 

i've a ComboBox that contains multiSelection webblock inside to allow the multiselect of data, i works fine and i'm able to select more than 1 option and save it in the database however i'm unable to retrieve these data and show it again to the end user if he clicks on edit for example. 


Any ideas on how to populate the multiselected data in the combobox

Hi Aya,

I have a solution but I don't know if it is the best. Let's see an example.

Suppose we have two tables:

The second table stores the selected users in the combo box.

Then with the following query we get all the users and if they are selected or not.

SyntaxEditor Code Snippet

SELECT {User}.[Id],{User}.[Name],{UserSelected}.[IsSelected]
FROM {User}
FULL JOIN {UserSelected} on {UserSelected}.[UserId] = {User}.[Id]


Bruno Marques wrote:

and then how can i populate the output in the combo box ? 

Hi Aya,

I have a solution but I don't know if it is the best. Let's see an example.

Suppose we have two tables:

The second table stores the selected users in the combo box.

Then with the following query we get all the users and if they are selected or not.

SELECT {User}.[Id],{User}.[Name],
CASE WHEN ({User}.[Id] IN
                                        (SELECT {UserSelected}.[UserId]
                                        FROM {UserSelected}
                                        WHERE {UserSelected}.[IsSelected]=1)) THEN 1 ELSE 0 END
FROM {User}




I used multiple selection with a list box instead of a combo box so that the multiple values can be choosen.

After that you should have an action that iterates over the list box and save it in the database.

Something like that

Bruno Marques wrote:

I used multiple selection with a list box instead of a combo box so that the multiple values can be choosen.

After that you should have an action that iterates over the list box and save it in the database.

Something like that

i don't have a problem in saving in the database but the issue is when the user wants to edit for the example, how can i populate the list box or the combo box with the multiple selected items that was selected and saved previously ?


In the query that populates the list box you will have a calculated attribute that will see in the database if the item is selected or not.

Going back to the users example, we have the GetUsers query:

SELECT {User}.[Id],{User}.[Name],{UserSelected}.[IsSelected]
FROM {User}
FULL JOIN {UserSelected} on {UserSelected}.[UserId] = {User}.[Id]

With the following output structure:

Then, in the list box we assign the IsSelected attribute


Don't forget to assign the list box widget to the multiple selection web block