I’m working on an app using data from a contacts sheet. Columns include name, address, phone, email, etc.
I would like to add a button that performs a simple action. Namely I would like it to pick a random contact (row) and display that row in the card view.
Like I said, I’m completely new to this but I’m having fun trying new stuff.
Right now my app is functional in that I have different sheets for different localities/regions, and can use the sidebar to pseudo-filter and view contacts by region. There is also a search function of all contacts. I can also invoke actions to call, email, and navigate to a contact.
I’m happy with where the app is, but I want it to always be improving it along with my knowledge of appsheet functionality.
I would like to eventually incorporate GPS into an action that shows nearby contacts’ locations. But that can be shelved until I get a better grasp on the platform.
Anyways, cheers. Looking forward to any feedback.
Hello @BrandonRing, welcome to the community!
A good place to start would be Actions; they will allow you create buttons that do various things (as well as hidden actions that can perform things in the background for you as well).
For picking out a contact from you table at random, check out RandBetween():
For your use, I would suggest a formula something like this:
RandBetween(1, count(Contacts[ContactID]))
This formula will randomly grab a row number from your contacts table, then you can use that in a LOOKUP() to pull that record’s ID:
LOOKUP(RandBetween(1, count(Contacts[ContactID])), Contact, _RowNumber, ContactID)
Once you get this far, you’ve got the ID (or the Key) of a random contact from your table.
From here you can use that inside a LinkToRow() formula:
LinkToRow(LOOKUP(RandBetween(1, count(Contacts[ContactID])), Contact, _RowNumber, ContactID), "Contact_Detail")
Have fun!
User | Count |
---|---|
45 | |
35 | |
27 | |
23 | |
15 |