Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!