Forum Academy Marketplace Showcase Pricing Features

Handle last item differently in a RepeatingGroup

I’m using a RepeatingGroup with fixed number of cells (1) to ask the user a set of questions. They input an answer, click submit, and my workflow uses “Show Next” to load the next question.

The issue: when user reaches the last question and clicks Submit, I want to indicate they are done (eg show a “Continue” button). I’ve tried custom states, collecting :count and trying to use a variable, all to no avail. Feels like there must be a simpler solution?!?

Any help much appreciated!!

I think you’re on the right track - have you tried using a database field?

I would setup a temp data field in your database to keep count of how many times someone clicks the next question button. Initial value set for 0 then add 1 in the workflow when the button is clicked. Then in your continue condition you can check for when this value reaches your last item. After they press continue be sure to reset the initial value back to 0.

There may be other ways to do this… but that’s the one I think of immediately.

You’re definitely on the right track. Can you describe how you tried the :count method because that’s done it for me before.

Each question should have a number assigned to it. Set a condition on a hidden continue button. When current cell’s question’s number is RG’s list of question’s : count > continue button is visible.

Does this help?


Gaby | Coaching Bubble

Thanks, John. I was able to solve this another way. In case it helps other users:

In Workflows, I added a new event triggered by clicking the Submit button. The trick was to add an extra condition to the event:

  • “When Submit button is clicked AND RepeatingGroup’s List of Question’s:last item is Current cell’s Question”

  • Action: hide the RepeatingGroup element, show a Popup with “you’re all done” and button to redirect to next page.

Worked like a charm!

2 Likes

Awesome!

Awesome thanks for sharing. I think your way is much more elegant I’ll remember it for the future :slight_smile: