Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
Trying to find the right way to send a multiple select input to backend

I have an events calendar app and using Ionic/React/Flask. There is a form for submitting an event. I have an item where you can select the frequency of the event. When you could just choose one it worked perfectly. But now I've made it so that the user can select mutliple options:

<IonItem>
            <IonLabel>Frequency</IonLabel>
            <IonSelect value={EFreq} multiple={true} placeholder="Select One" onIonChange={e => setEFreq(e.detail.value)}>
              <IonSelectOption value="Weekly">Weekly</IonSelectOption>
              <IonSelectOption value="1st week">1st week of the month</IonSelectOption>
              <IonSelectOption value="2nd week">2nd week of the month</IonSelectOption>
              <IonSelectOption value="3rd week">3rd week of the month</IonSelectOption>
              <IonSelectOption value="4th week">4th week of the month</IonSelectOption>
            </IonSelect>
          </IonItem>

When the user selects multiple options the state variable becomes an array like:

['1st week','2nd week']

When I send this to my Flask backend I get an error

Operand should contain 1 column(s)

I thought if I could somehow join the array elements like 1st week 2nd week that could work.

So I tried to take the state variable and join it like

SetEFreq(Efreq.join())

but haven't quite figured that out yet but am told that it's not great to change the type from an array to a string. It's error prone.

So right now I'm not sure how to handle this. Should I try and get my flask backend to accept the array? Should I find a way to alter the input so it is just a string that goes to the backend? Not sure what is the best approach. How do people do a multiple option form input with flask?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda