How to fill a drop-down field with a record of multiple values separated with ";"

Hello,

I need help to fill a drop-down field with a record of multiple values separated with “;”.

I have a table named categorias:

id_categoria categoria
1 Blue
2 Red
3 Yellow

And another table named delegaciones with one field of multiple values separated with “;”

id_delegacion delegacion id_categorias
1 Barcelona 3;1
2 Madrid 2
3 Valencia 3;2

I’ve created a form with a drop-down field that should contain the names of areas of the id_delegacion selected with this automated lookup:

select delegaciones.id_categorias, categorias.categoria
from delegaciones
inner join categorias on delegaciones.id_categorias = categorias.id_categoria
where id_delegacion = {id_delegacion}

The problem is the drop-down field only shows this:

3;1 - Yellow

I want to fill whith this:

3 - Yellow
1 - Blue

Please help me

Explode the fields and generate a string like ‘field’,‘field’,‘field’
then modify the sql statement within the lookup using the IN operator. Then you will achieve the desired result.

tnx, ALbert

Can you write a example please?