After trying for a long time, I came up with a pretty easy way to build the functionality I wanted.
Desired Functionality: Use toggles in a repeating group to allow user to select or deselect multiple elements in a mobile app. Bonus: Ability to use same form for initial setup and subsequent edits.
The setup for this uses conditions to set image based on if the item is already in the list. I made the ON / OFF images as SVG’s in Sketch. This allows for the toggles to always reflect the state of the database.
The data structure is simple. One table is regions, and in the user table, one field is a list of items, type: regions.
Two workflows are created to either add or remove an item to the list. These trigger off the toggle image element. When the item is not in the list, add to the list. When it is in the list, remove it from the list.
Pretty simple to set up and keep organized, and the data is saved live as user makes changes. The only downside is there is a slight delay before the image changes as bubble.is does the work in the background.
Ideally, I would like to have user set Ionic toggles or even a checkbox on or off. Then when user clicks save, the entire list is set to mirror the state of the toggles (If ON, keep in list, if OFF, remove from list). This would eliminate the slight delay.
I could not for the life of me figure out how to do that because while we have :plus item for state changes, we cannot :remove item, nor can we query the state of a toggle for elements that were not changed to replace the entire list.
If anyone has any idea on a better way to do this, please let me know!
-Ben