Wondering if it’s possible to filter table from a field that acts as a sort of “quick find” field. I could swear I’d seen an example in some training video but I can’t find it.
I did find an example showing how to use a button. Useful, but not what I’m trying to do.
What I’d like is to have a field floating above a table (or table view). Let’s say that the table is a list of people. I’d like to put a field labeled something like “Filter by Name” above the table. If the field is blank, then all records are displayed. But if user clicks into the field and types “William”, they’d find me, and William Shakespeare, and William Henry Harrison, and Prince William. I can write the filter formula. I just can’t figure out how to put that field above the table and how to trigger it.
Use case for which I want this: If table is a list of people, users will 90% of the time want to filter on the person’s name or part of it. Asking them to click on the Coda filter widget, and configure the filter, is more trouble than they’ll want to go to over and over and over again.
To achieve a similar goal i’ve set up something like that:
A one row-one column table that act as a search box (filtered in a way that every user have his own row, so if user a search something also user b can do the same at the same time)
The table with all the name below is filtered according to what is contained in the search box
Thanks @Mario, and thanks especially for mentioning the need for each user to have his/her own row in the quick-search table. I think I understand this. Will try to get it to work and get back to you if I run into a snag. Many thanks!
Thanks @BenLee. That’s an extension of the earlier suggestion by @Mario, adding regex. Very nice and it’s clear now that, one way or another, I can make this work.
But I’m wondering about something else. In both suggestions, the search term is entered into a field in a utility table with just 1 record displayed. But is there a way to prevent the user from clicking the + button to add a row to that utility table?
Good question. An extra row can accidentally get added for that user, but I think I have the search set up to take the first value if there are multiple, so the user just needs to delete a row. That search table is also filtered to only show the logged in user rows, so you see your’s and they see their’s.
Wonder: Would there be a way to notice when there are 2 rows in that search table created by the same user, and if there are, trigger an action to delete all but one?
I’m still trying to get familiar with triggering events in Coda…
Sure! For me, the best way to figure out, and then use events, was to create buttons. All buttons have a “Disable If” feature, so add a formula to exclude rows this way. Then you can create a canvas button that pushes all the buttons in that column…if they’re disabled, they don’t get clicked.
This is an easy way for me to try a filter in a button and I can visually see what rows it’s affecting.
Another button I’ve added to this type of setup is a canvas button to Add a Row to the search table if there are “0” rows for a user. If there are more than “0” rows for the logged in user, this button is disabled. I label it something like “Start Searching” so if they don’t see the search box row, they have something to click that gets them started.