Repeating Group Multiple Select Save to Database

Hi,

I have a survey in where I am asking the user to select up to 8 selections. I want to highlight the options they select and then commit them to the database once hitting “Continue”:

Above you can see that I have got the formatting working. The way it is set up is that the outlined shape has a boolean custom state “selected” which is switched in workflow when the button is clicked.

What I am trying to do now is to identify which boxes have a “Selected” state = Yes and then commit them to the database as the list “Market_Experience” populated by option display names. In the above the result would be a list:

“Stocks and bonds”
“Private real estate limited partnerships”
“Precious metals or collectibles”
“Venture capital”

Option set:

List I want to populate:

Where I am stuck:

In the above I am trying to make changes to the “Markets_Experience” list with the four options above based on their shape’s state, but I don’t have the option to do that. I suspect I need to pass data from the shape to the repeating group or something similar, but I am lost.

Any help appreciated. Thanks! Turned editing on:

@mikeloc if you got any ideas!

Instead of “set list” have you tried “merged with”. Something like such:

I believe the second workflow is Data > Makes changes to a list. What is the first for “Search for…”? How do I find that?

If you can check out my app (link above) that would be super helpful. This is Step 9. @SerPounce

Ha! I was looking at it, @chrismoris … just hadn’t come up with a solution yet. :slight_smile:

Edit: Looks like you’re in good hands with SerPounce and Keith, though!

Ah I see. Try this:
Create a custom state on the page called something like “MarketExperiences”. Make it a list.
Then add workflows when the buttons are clicked to add the current button’s underlying value to the custom state.
Then in place of my “search for” you will merge with your list stored within the custom state “MarketExperiences”.

When the option is set, push it into a list of type Market_Experience:

That list is anr custom state you should create. Inside your workflow that toggles your button’s appearance to “selected” do:

Element > Set State (what state? List of Market_Experience. What value? Value = List of Market_Experience :plus item (relevant state)

Do the opposite in the workflow that sets appearance to deselected;

That is, value = List of Market_Experience :minus item (relevant state)

Now you have a list of Market_Experiences that you can set in your database thing.

Okay, to summarize, I think the guidance is:

  • Store the state as a list of type Market_Experiences (Object type)
  • Store the state on a global item (page, or the floating group for step 9) not on the shape in the RG
  • Use this state list to merge with Market_Experiences (Database type)

Couple questions:

  1. Should I do the conditional visibility of the buttons and their states based off this list or off the shape as it is done now?
  2. How do I bring up the merge / search for option in workflow?

Thanks

Re 1: Doesn’t make a difference as far as I’m aware.
Re 2: Once you’ve created custom state, it will automatically be available within the element > state.