How to solve multiselect dropdown error?

I want to allow users to edit an existing group of instructions (they can remove instructions and add more from the drop down):

The initial value of the multiselect is set to the instructions that were previously selected (stored in a selectedvar):

The above doesn’t work as no instructions show up, so I changed it to this (but it doesn’t work as well, as i will show below):

The options for the dropdown is binded to a collection of instructions in xano.

On change, I have a workflow:

I want the user to be able to remove existing options from the selectedvar and then save it.

The problem is when I attempt to remove any instructions or add new ones, it doesn’t work. when I remove the instruction, all the instructions are deleted from the multiselect element. When I try to add a new instruction, it doesn’t show up in the multiselect element.

How do I allow users to edit the instruction groups?

Hello @raelyn,

To display your initial value, you need to do like your first screenshot. And use the function map with the “id”
You need to do that, because value field you defined for your option is “id”, so the initial value need to be a list of id

I am not sure to understand the second point of editing. Could you give us more detail?

Hi Mael! I have tried to map the function to the id, and the initial value shows up correctly, it’s just that when I attempt to remove any instructions, all the instructions disappear.

And then when I attempt to add any instructions from the dropdown (options binded to Xano collection), nothing happens…

Currently my initial value is as such:

Options binded is same as before:

On change workflow:

When I try to remove any of the 2 options, all of it disappears. When I try to open the dropdown and select another option and click on it, nothing happens.

I think the issue is that you don’t have the same format for selectedInEditor after your on Change, so your formula that you are using for the initial value is no more working, and you created an issue

I don’t have a visibility of the format of your variable at the beginning, so it is difficult to give you detail, but it seems to be the issue

And on change, you shouldn’t use the variable .... - current selection. You should use event.value