RG Pagination issue: more pages than items?

So I have a survey that after it’s completed, I wish to show the user the results of the survey, showing all results on record in a pie chart. There are two types of questions, multiple choice, and write-in. I don’t want to show results for write-in answers, only multiple choice. So the user will only see question/answers of multiple choice questions in a pie chart. They will be able to navigate back and forward using buttons beneath the pie chart.

Basic Database Structure:
Survey (name, list of surveyquestions)
SurveyQuestion (question, list of survey answers, type (OS: Multiple Choice, Write-in), order)
SurveyAnswer (answer, surveyquestion)
SurveyResult (list of surveyanswers, survey)

So I have a RG Survey Result Questions, which uses the SurveyResult survey’s surveyQuestions, that is filtered to only contain question type Multiple Choice and sorted by question order, and the RG is set to a fixed number of rows and columns (1 & 1).

The buttons use WF element action to go to next or previous page.

Pie chart is in the RG and datasource is a search for SurveyResults (this survey), each item’s surveyAnswers: filtered by parent group question (the cell in the RG Survey Results) : grouped by answer.

This works as I expected, EXCEPT that it seems there is a glitch that I have to click next twice to navigate from Q3 to Q5 or Q2. For example, I have 5 questions:

  1. Write-in
  2. Multiple Choice
  3. Multiple Choice
  4. Write-in
  5. Multiple Choice

When the results are shown, it starts at Q2 as it should. When I click next, it goes to Q3. When I click next again, nothing seems to happen. I click next a second time in a row, and then it goes to Q5.

If I go backwards from Q5, I click previous once I go to Q3. Then I have to press previous twice to get to Q2.

I’m not sure why it is requiring a double-click to paginate from Q3 to Q5 or Q3 to Q2, as Q1 and Q4 should be filtered out and not in the RG. When I use the inspector, it seems the double click is navigating to the next page, and the two middle pages are page 2 and page 3, but they have the same values.

I also realized that during the survey, the same issue happens, where it seems Q3 requires 2 “next” button clicks to move to Q4. Looking at the inspector, the final page of the survey (the fifth and final question) is listed as page 6, as it seems Q3 is both on page 4 and page 5.

I’m a bit stumped here, as there are only 5 questions on the SurveyQuestion table. What’s going on here?

Put a status on it. If completed show a thank you group have a button there that sets a state for “answer view mode” yes/no

If yes then have answer display group showing.

If no keep showing the thank you page

I have a complete template for advanced form building like this I’m about to actually release :slight_smile:

This doesn’t address my question.

I have no problems going from the survey to the result, the issue is that it seems the 3rd question requires 2 next page actions from a workflow to get to the 4th question, and likewise when displaying the results. Hence that I have more pages then actual results in my RG, where there is duplicate page of what is result 3 (third question) that shows up in two different repeating groups where the question is referenced, and I have checked the database and there is no duplicates, only 5 questions total.

Guess I misunderstood sorry about that.

That is quite odd behavior, without seeing the app it’s hard to actually nail down the issue. Feel free to DM me a view link and I’ll see if I can get an answer for you

No worries, I figured it out. Seems like the survey had the 3rd question twice, which explains the duplication. Writing out your problem like this helps see the only possibilities, so I appreciate the feedback. :slight_smile:

1 Like