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?

Hi @Open_Up

Welcome to the community !

You may want to check this option:

2 Likes

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.

1 Like

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!

Hi @Open_Up

I got it.

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

1 Like