Variable bug on single select
# 🤝help
g
Hello everyone, I have a bug when placing a variable in the single selection, this image appears below:
a
@early-train-33247
e
Hey guys! This is happening because the Items variable needs to follow a specific format, it must be an array of objects with this structure:
Copy code
js
{
 label: "Segunda-feira",
 value: "monday"
}
g
Hello! The error occurs the same way using this structure. What I need is to put a variable in the option.
e
Probably because you used the same code I gave you, the Items input needs to be an array. So in a Execute Code will you need to build the workflow.segunda list with objects formatted like above:
Copy code
js
workflow.segunda = algumaLista.map(item => {
 return {
  label: item // aqui depende do tipo da variabel item, se for uma string pode ser assim, se for objeto tem que falar o parâmetro (item.nome)
  value: item // mesma coisa, mas o value é o que passa a ser o valor da variável que você está capturando com choices   
 }
})
6 Views