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! Go to Solution.
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.
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?
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
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
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.
Thank you for the update. Good to know the expression works as you wanted.
User | Count |
---|---|
44 | |
28 | |
28 | |
21 | |
13 |