How to automatically re-order the list of questions in sequential order?

Hi, I have a data table that allows the users to fill in a question form and each question is listed in order of 1,2,3,4,5,6โ€ฆ14
The user is not allowed to put in a repeated question number.

However, if the user edits the question number from 2 to 15 and saves it.

After saving, the question number is no longer in the sequential order and becomes 1,3,4,5โ€ฆ15

How can I make the order become sequential automatically after a user edits the question number?

0 5 241
5 REPLIES 5

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Open_Up

Welcome to the community !

You may want to check this option:

Hi, thanks for replying. Iโ€™ve done that but it doesnโ€™t solve what iโ€™m looking for. I need the question numbers to change back to being sequential. Now, it is showing 1,3,4,5โ€ฆ15 after I edited question number 2 to 15.

What is showing now as question 3, should be 2, 4 becomes 3 and so on until the last one becomes 14.

This is a really tricky question! It sounds like that when one record is changed, youโ€™d like all other records in the table to change for a specific column. Youโ€™d also like this to be conditional where if the row youโ€™re changing is greater than the value of other rows, donโ€™t change those rows. And if the row youโ€™re changing is less than the value of other rows, decrease those rowsโ€™ values by 1. To be honest, I donโ€™t know how to add this kind of conditional updating.

One sneaky way of fixing the โ€œissueโ€ of users seeing non-sequential Question Numbers is to hide the field for all views except a Form view. I would do this in the Show If expression of the Question Number column:
CONTEXT(โ€œViewTypeโ€) <> โ€œFormโ€

This would mean that users would only see the question number if they were editing the question. But the questions would still be ordered based off of their Question Number values. I would also recommend adding an expression in the Valid If field to make sure that all Question Number values are unique so that you donโ€™t get two Question Number rows with the same number, since users wouldnโ€™t be able to see the combined list of all recordsโ€™ Question Numbers. Finally, I would also recommend that you somehow split the user experience of users who change and build the questionnaire and users who fill out the questionnaire. You can do this with a Permissions/Users table or just make a specific slice and view for users of a certain email address.

Hi @Open_Up

I got it.

You may want to have a look to this tip, sounds like something you wish to perform ?

Hi, thanks for the inputs. It is not possible for us to hide the question number as our user (trainers) will need to know the number of questions theyโ€™ve created or the order of it. Just shouting out to the community here if anyone has an idea of how we can improve the conditional formatting/app scrip/any solution to make it work!

Top Labels in this Space