Numbering questions

Hello,

I have a table with 30 questions and I would like to display the current number e.g. 1, 2,30, beside each question when showing it. The issue is this list is editable. So if I have a column and have numbers 1 to 30 in the column and then a user deletes e.g. row 15, and adds a new row, then I will have numbers 1-14, 16-31 numbers which is not what I want.

I can do this using a workflow rule and google script, and anytime a user adds or deletes an entry have the script regenerate the numbers, however I was hoping there was an easier way directly in appsheet. Note the number doesnโ€™t have to be saved in the database, I just need the current index for each entry. Is there some context variable that I can access for this?

Thanks,
Steve

Solved Solved
0 7 334
  • UX
1 ACCEPTED SOLUTION

Hi @Stephen_Monaghan,

Please explore if creating a VC for the question numbers with an expression something like below helps

COUNT(SELECT(Table Name [Key Column],AND([_ROWNUMBER]<=[_THISROW].[_ROWNUMBER] , [_THISROW].[Email]=USEREMAIL(),NOT([Email]<>USEREMAIL()))))

Since the count is based on VC and needs to update based on added or deleted questions by the user, the count refreshes once the add or delete question ( or row) operation is synced by the app.

You may need to add suitable additional conditions in the above expressions-for example if there is one test possible on a day , then [Date] qualifier may need to be added. If there can be two tests possible on a day then [Test Number] qualifier and so on.

Hope this helps.

View solution in original post

7 REPLIES 7

Iโ€™m confused. Itโ€™s not clear to me if you your numbering is for columnโ€™s or rows. Also you said

โ€œโ€ฆ then a user deletes e.g. row 15, and adds a new columnโ€ฆโ€

A user of the App cannot Add or delete Columns

Can you try to explain in a different way?

Simon@1minManager.com

Hi Simon,

sorry, I mean adds a new row, not column. I will edit it.

Steve

Iโ€™m not sure that possible, at least not easily. Appsheet only has functions for finding the top and bottom values in a list

Sort(Select(TableName[_RowNumber],[user]=UserEmail()))

This would create you a list of relevant row numbers in order assuming [user] inital value was UserEmail()

Sounds like you need to use https://support.google.com/docs/answer/3093378?hl=en

Simon@1minManager.com

Hi Simon,

thanks for youโ€™re reply. Looks like Iโ€™ll have to do it a different way then, or just give up on numbering the questions.

Steve

Hi @Stephen_Monaghan,

Please explore if creating a VC for the question numbers with an expression something like below helps

COUNT(SELECT(Table Name [Key Column],AND([_ROWNUMBER]<=[_THISROW].[_ROWNUMBER] , [_THISROW].[Email]=USEREMAIL(),NOT([Email]<>USEREMAIL()))))

Since the count is based on VC and needs to update based on added or deleted questions by the user, the count refreshes once the add or delete question ( or row) operation is synced by the app.

You may need to add suitable additional conditions in the above expressions-for example if there is one test possible on a day , then [Date] qualifier may need to be added. If there can be two tests possible on a day then [Test Number] qualifier and so on.

Hope this helps.

This is exactly what I wanted. Thank you very much.

Hi @Stephen_Monaghan

Thank you for the update. Good to know the expression works as you wanted.

Top Labels in this Space