Repeating Group's Conditional Button

Hello. I need assistance with conditional logic for buttons. I have a fruit quiz list in a repeating group. The fruit quizzes are listed in chronological order as a data field entry.

What I want to have work (index page):

  • The quiz starts with fruit chronological #1 with the only clickable button called “Start”
  • The quizzes must be completed in chronological order.
  • As the quizzes are completed, their corresponding button changes to “Completed”
  • After a fruit quiz is “Completed”, the next fruit quiz’s button changes to “Start” and is clickable

  • NEED ASSISTANCE: In the picture above, I need to have the blueberries “Not Completed” button show the “Start” button.

On each fruit quiz template page,

  • after the correct answer is entered and submitted, I have a clickable button that shows via a state. Clicking on it should send the user to the next fruit quiz in chronological order.
  • NEED ASSISTANCE on the navigation data to send in the workflow so the user gets to the next fruit quiz.
    I am able to change the fruit quiz’s button to show “Completed” and “Not Completed” through conditions, but I can’t set up the conditional logic to show the “Start” button after the last “Completed” fruit quiz in chronological order.

After getting the fruit quiz correct, it is stored in the user data. I also have the user added to the completed fruit quiz, which is part of the conditional visibility for the “Completed” and “Not Completed” buttons.

Any help would be greatly appreciated.

Screen Shot 2022-03-15 at 2.48.11 PM
Copy and paste this exact conditional below it. Then chain on to the end of the when statement and add ‘AND Current User’s fruit quizzes completed contains Repeating Group Fruit Quizzes’ List of Fruit Quizzes:item #Current Cell’s index - 1’. Then make it clickable and set the text to ‘START QUIZ’.

Thank you @williamtisdale After reading your reply, the logic makes sense. For some reason, the condition won’t integrate the - 1 after Current Cell’s index.

I will try again.

Be sure to use Bubble’s provided minus(-) instead of just typing a hyphen(-).

@williamtisdale I followed your steps, but Bubble doesn’t offer any other selections.
If you have a few minutes, I changed my app to editing. Can you see if you have the same issue? This is making me crazy :crazy_face:

I found a post on the forum that mentioned you could place a group inside a repeating group cell and give it a type of number and set the data source to current cell’s index and there it will let you alter the number. So I added a Group Previous in the repeating group cell that is Current Cell’s Index - 1. Now in the conditional on the button it just references that groups number as the item number and everything is working. I also had to add an extra conditional for if the current cells fruit quiz wasn’t completed and it cell’s index was 1 because for that first cell the other conditional would never be true.

@williamtisdale Thank you so much for finding and actually trying the workaround. I’m finding out simple in function isn’t simple with logical conditions. I’m going to play around with this and implement it on another project. Thank you for saving me hours!

Well done :slight_smile: :smiley:

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