Filter view on a repeating panel which is linked to a data table

I am trying to create basically a glorified todo list/goals/journaling app. I have linked a repeating panel up to a data table. the data table has several columns but one column is filled with a list of categories. I have buttons on my sidebar which there is one for each category. I would like to on the press of a button filter the repeating panel to only retrieve that data from the data table which is in the corresponding category. I’m pretty new to coding so I tried this and it didn’t work.

button_category_click(self, **event_args):
self.repeating_panel_1.items = app_tables.my_table.filter(RepeatingPanel(items=‘category’))

any help would be much appreciated. thanks.

Welcome to Anvil @jordaddy1 !

In Anvil, the way to query data tables is with the search method with the column name(s) being queried as the keyword argument(s):

app_tables.my_table.search()

with query functions as outlined in this blog post that are arguments in the search method:

For filtering on the UI side, this is a relevant post from yesterday you might also be interested in:

Thanks duncan.
With the app_tables.my_table.search() what do you place within the parenthesis to help it find a particular category in a particular row?

See the linked blog post for more details, but aomething like this:

app_tables.my_table.search(col_name=q.full_text_match(“hello world”))

You can add as many column names as you want as keyword arguments, you aren’t limited to one.

There are a bunch of other queries available as you can ses in the documentation too.

1 Like