Trigger based on conditional state of elements in repeating group?

I’m using an option set with a list of the U.S. presidents with name and number to create a little quiz. A repeating group shows 46 numbers with a corresponding input box.

If the user enters a correct name beside a number, the icon turns green. If their answer is incorrect, it turns red. Is there a way to trigger a workflow when all of the answers are correct?

Can I tell Bubble to do something based on the conditional state of elements in a repeating group? Or can I somehow keep score based on changes on the page?

Hi there, @John_Notgrass… you can definitely keep score based on changes on the page, and that is probably the route I would go. There is a workflow called An input’s value is changed that you can use to do something when a user makes a change to an input such as the dropdown in your repeating group. So, you could do something as simple as having a number field on the User data type that stores the number of correct answers a user has, and you could update that field every time one of the dropdown values is changed. You could then check after every update of that field whether or not the number has reached the total number of correct answers, and when it has, you could run another workflow.

So, again, what you have described is possible, and there is more than one way to go about it, depending on your exact requirements.

Hope this helps.


1 Like

Thanks, @mikeloc .

I was able to use @hanan1 's video here to help me use a custom state on the repeating group to keep track of the user’s score as they are adding correct answers:

Set multiple custom states in repeating group? - Need help - Bubble Forum

1 Like

If you don’t need the score to persist across a page refresh/load, then a custom state can certainly work.

This topic was automatically closed after 70 days. New replies are no longer allowed.