Help

Re: FIlter records by the currently logged in user

4331 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Matte_Silver
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi

Is there a way to filter records by the current user?

E.g.
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.

9 Replies 9

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).

Matte_Silver
5 - Automation Enthusiast
5 - Automation Enthusiast

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

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.

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?

Here is the support page on shared view URL filters.

Here is the documentation for scripting. You find the current logged in user from the session. However, unless you already know JavaScript, trying to learn scripting when you are new to Airtable may be a bit much to learn all at once…

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.

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.

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.)

Thank you so much, @kuovonne, you’re the best.
I’ll definitely keep your offer in mind.
Cheers

AnaG
5 - Automation Enthusiast
5 - Automation Enthusiast

Another workaround will be to use a Portal that integrates with airtable and will allow you, in one single view to show only those tasks related to the user that is log in. Or even send user's directly to the results you want them to see, by using a Prefilled