I’m making an app where you can create an account for a person, and then record a visit with the persons account and date of visit.
I have it set up so that when someone visits, I can go to a form view, select a date, and then select the account that visits, and then add it to the records (creating a new account when they’ve never visited before).
I have 2 tables set up: “Accounts” that stores all the info like Name, Number, Address, etc. ; And a “Records” table that references that name on the “Accounts” table and then creates a new row with the reference and the date. Hence, recording the visit.
MY QUESTION: I want to be able to have a deck view called “Accounts” that shows all accounts created AND organize it by the number of visits by each account. I’d like to be able to show the number of visits by each account name as well. I have the deck view set up but I can’t for the life of me figure out how to organize the view by the number of visits.
I’m very new to Appsheet and I have little to 0 coding experience. If there’s any code I need to put in please tell me where to put it. Thanks
If not, I suggest elaborate by clarifying which AppSheet view type you mean by “list view” and maybe illustrate with your current view and even a mock-up of what you’re seeking to create.
Hi, I followed the steps and seemed to get the sorting working, however. Completing my form no longer adds data to the table and each name has a warning sign by it:
Also, I have the deck view set to sort by the ref column and then by name if the ref column value is the same. However, it doesn’t do that. It puts the highest visits on top but doesn’t organize the entries with the same amount of visits at all:
Likely this is a Ref type column and you created a Valid if expression that returns a list of values that are not from the key column of the referenced table. Change the expression to return values from the key column (you may need to use ORDERBY instead of SORT), and the table’s label column values will still display for the user.
If my original reply’s suggestion to use the view’s Group by property doesn’t meet your need, then I don’t understand what you’re trying to accomplish.
The group by property groups all the accounts by number of visits. I just want all the accounts sorted from most to least visits, not split into groups
Is there something I’m missing here? Is there some sort of function or code I need to write that counts the amount of times each referenced name appears in the table and displays that amount? If so, please elaborate. Thank you
The value of each row’s [Related peopleRecords] column is a list of its related records’ IDs–not a count of those records. In a table view, that list is summarized as a count for display. Try instead indeed creating an additional column that is truly the count: