Send repeating group data and nested toggle to external API

I’m trying to provide an interface for a user to source some data from an external API which is returned into the repeating group where I have the Ionic Toggles on each row that they can in turn toggle on to “select” that item.

Then, after they’re done selecting each item w/ the toggles, I’d like to give them the option to “preview” the result of their selections.

My goal is to either send only the items they have toggled on to an external endpoint OR to send each row, but have a boolean value letting me know what they selected.

My only idea is to have the concept of a “draft” thing to store their selections locally which I then send back out w/ the external call. I don’t love this idea as I then have to think about cleaning those drafts up if the user abandons the setup.

Any thoughts?

Ok, nevermind!

There’s a great answer here to solve this for anyone else who comes across it:

Just use two workflow triggers for the toggle that fire when the toggle input is checked/unchecked:
image
Then for checked, use the solution above to append a value to a custom state on the repeating group:
image
For unchecked, the opposite:
image

Setup your API call and pass the custom state through:
image

It works! Bubble you flippin’ rock!