Update a list from multiple inputs

Hello, I am stuck on something that I feel like I have solved previously, but my current results are certainly telling me otherwise :sweat_smile:.

I have a data type called Notebook, and Notebook has 6 user-defined data fields called “Categories”. The data field for Categories is a text type. I have a simple interface where 6 text inputs allow the user to update all 6 categories simultaneously.

I also have a data field called “All Categories”, this one is text as well, but it is a list that gathers categories 1-6 in a single data field. There is no way for the user to update this field directly. It is defined through workflows.

I’m trying to set my workflows so that when a user updates one of the 6 inputs for the 6“Categories” data fields, the “All Categories” data field is updated with a list made from the 6 inputs. But the Bubble editor does not give me access to a “join” operator when I am updating the All Categories data field, or any other means to compile multiple inputs into a list.

I also tried passing to a state as arbitrary text, separated with commas, but the workflow will not accept that as a valid list.

I figured it out. Instead of adding the list in a single “update a thing” field entry, I simply repeated the “change another field” option and kept updating the “all categories” field by iterating through each input.

Nice! This approach works perfectly as well. Just keep in mind that when the user edits these categories again, you need to reset the All Categories list first, and only then run the logic that adds the 6 categories again.

Another option would be to do this using “Arbitrary text” which would also work. In that case, I would do it like this:

You would combine all the inputs into a single arbitrary text, using a separator between each value. Then, in the arbitrary text expression, you would use the “split by” operator with that same separator. Finally, instead of using “add” when updating “All Categories” you would use “set list” since you’re replacing the entire list at once.