# Dynamically Filter a Table or Search

**URL:** <https://forums.knack.com/t/dynamically-filter-a-table-or-search/8722>\
**Category:** Get Answers\
**Created:** [January 19, 2021, 12:24pm UTC](https://forums.knack.com/t/dynamically-filter-a-table-or-search/8722 "2021-01-19T12:24:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkSalamo41054](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@MarkSalamo41054](https://forums.knack.com/u/MarkSalamo41054)\
**Post date:** [January 19, 2021, 12:24pm UTC](https://forums.knack.com/t/dynamically-filter-a-table-or-search/8722/1 "2021-01-19T12:24:29Z")

</div>

This may be possible some other way than what I am suggesting, but let me explain my goal first.

I have created an app to track information by Office.&nbsp; (Let's say it's sales data.)&nbsp; Every User logging in to the app is also associated with an Office.

When the page loads (with either a table or search of the sales data), I want it to by default filter the data that comes back to match the logged-in user's Office.&nbsp; Note that I am not applying record-level permissions.&nbsp; A user from OfficeA does have access to sale data for other offices, but I simply want the data on this page to only show data for the user's office by default.

This could either be a limit applied at the DataSource level or an Office filter value applied by default.

One way this might be accomplished is by supporting a variable in the DataSource setting for the table or search, like:&nbsp;

Office is ${User.Office} -- referencing the Office of the applicable User Object

or

Office is ${userOffice} -- where userOffice is the name of a js variable that is available in the render listener for that scene.

Of course, any other method of achieving this goal would be greatly appreciated.&nbsp; Note that I don't believe there is any way to use URL parameters for this purpose, as the values will not be known until the user logs in.
