Oct 09, 2021 01:01 AM
Is there a way to filter records by the current user?
I have 100 users, and a tasks table. I’d like to have one kanban view that show’s to each user their own tasks.
I know I can filter by particular user, but that means I need to maintain 100 views, one for each user.
Oct 10, 2021 01:43 AM
Welcome to the community, @Matte_Silver! :grinning_face_with_big_eyes: Driving a view filter based on the active user wouldn’t work very well. What if two users opened the same view? Which one would Airtable use to filter? When any view is modified—filtered, grouped, or sorted—the results are shown to everyone who is looking at that same view. In other words, it’s only possible for a view to have a single filter that’s shown to all collaborators.
However, shared views don’t have this restriction (mainly because they aren’t refreshing in real time). Using a shared view URL filter, each user could open a view of their own tasks by adding a filter option to the URL that filters based on the collaborator field (where you’re assigning tasks to users).
Oct 10, 2021 05:48 AM
When I have a view filtered by current date, opening it on different days shows different data. Same way I’d like to filter by current user and when two different users open it, it would show different data
Oct 10, 2021 06:38 AM
I’ve done this with a slight tweak. I have a “menu” table with a button that runs the script to identify the active user and then build the url for the prefiltered shared link. The link is a bit tiny but it is better than hunting through a long list for one’s name.
One problem with this workaround is that the prefill tee does not work if there could be multiple people associated with the task.
It is also difficult to make updates to values in the shared view. One option is to have a button that opens the original record in the expanded view.
Also, you have to manually refresh to get any changes.
Oct 11, 2021 04:04 AM
That sounds fantastic.
Unfortunately I’m too new with airtable to understand your answer. Can you offer some links to the relevant documentation or your script please?
Oct 11, 2021 06:33 AM
Here is the support page on shared view URL filters.
You would need a custom script adapted to your specific base. If you have budget to hire a script writer, you can book an appointment with me to discuss your needs.
Oct 11, 2021 01:31 PM
That’s because there’s only one current date. It’s not possible to have multiple versions of “today” to filter by, whereas multiple users logged in from different locations could muddy the waters when trying to figure out who’s the “active” user.
Oct 11, 2021 01:36 PM
That’s sort of true. Some would argue that there are two different date at any given point in time, depending on what time zone you are in. In general Airtable works off of GMT time.
But this is getting away from the particular topic at hand.
Airtable considers a view to be a set of records with a particular filter and grouping that is independent of a user’s logged in session. The user can change the view’s filtering and grouping, but those changes affect everyone and everything.
Having a view that changes based on the logged in user makes sense from a user point of view, but doesn’t really work when you consider all the other things that a view is used for (e.g. page designer, charts, automations, etc.)
Oct 11, 2021 02:09 PM