I have a form in WeWeb with a list of checkboxes. On submit, I’d like to send these values to Baserow and store them in a multiple select field. I was able to accomplish this, but I’m new to WeWeb and this took quite a bit of bumbling. I’m curious if this is a reasonable approach or if there are simpler ways to go about this.
Unfortunately, since this is my first post the forum will only allow me to add 1 image. I’ve uploaded screenshots of each step to this Google Drive folder for reference.
Here’s what I did:
- Created a variable to store each checkbox value. For example, a variable titled “Apples”, set as a number, with a default value of 0.
(See Screenshot2)
- On the checkbox, I added a workflow to detect a change to the checkbox.
(See Screenshot3)
If the checkbox value is true, it assigns a value to the variable that matches the value of the option in Baserow. For example, if the Apples checkbox is selected it assigns a value of 1717404 to the Apples variable.
(See Screenshot4)
I repeated this for all checkboxes. So each checkbox has it’s own variable. Each checkbox also has it’s own workflow that detects a change in the checkbox and either assigns the corresponding Baserow value (if it’s checked) or 0 (if it’s unchecked).
- I created a new variable called Favorite Fruits, set as an Array.
(See Screenshot5)
- In the form submission workflow, I add a step to create the Favorite Fruits array after submit but before making the Baserow REST API request. This uses the createArray formula to list all the values. I also add a filter to filter out the 0 values.
(See Screenshot6)
- In the REST API request, I add a field where the key is Favorite Fruits and the value is the Favorite Fruits Array variable.
(See Screenshot 7)
Since I’m new to this process and I’m still learning concepts like variables/workflows/etc I’m hoping to learn if this is a reasonable approach or if there are alternative/simpler ways of accomplishing what I’m trying to do.
Thank you!
P.S. I’d also love to hear if this was a good way to ask this question or if there are better ways to show what I’m doing and ask for help!