I’ve managed to store certain types of for into one simple object to save space and performance. As in the examples below
After that its displaying in a repeater, but I’m trying to be able to filter by type and not show all the extra text.
Error:
TypeError: list indices must be integers or slices, not str
example code:
def FruitFilter_click(self, **event_args):
“”“This method is called when the button is clicked”""
pass
self.repeating_panel_1.items = app_tables.list.list_columns(StoreInfo={[“Type”][“Fruit”]})
def VeggiesFilter_click(self, **event_args):
“”“This method is called when the button is clicked”""
pass
self.repeating_panel_1.items = app_tables.list.list_columns(StoreInfo={[“Type”][“Veggies”]})
https://anvil.works/build#clone:BZ67Y5CBKZG5QWGW=V6IF6VLPGV5TRAABFAZBFIVJ
Ok, found a way to fix the error and now it filters Fruit.
self.repeating_panel_1.items = app_tables.list.search(StoreInfo={"Type":"Fruit"})
But how do I break a simple object into a list? Leaving out Veggies if they are in the same simple object?
I’m not sure I understand the problem fully, could you be a bit more clear as to what you’re trying to do?
It seems like you no longer have a list
database in your app, so I was not able to test it out properly through the clone link.
Sorry, I was updating throughout the weekend so that was probably the reason for any issues with your tests.
Here is a new link.
https://anvil.works/build#clone:BZ67Y5CBKZG5QWGW=YAEY4EDYYTP36LPXBQAQC6HG
What I’ve done, when you click add to list, it builds a list into single row to save space and performance.

What I’m tryin to do, on the see page, is take those Yellow combined list and break them into individual items for the flow panel. instead on one long list.
Thank you for any help. I really appreciate it.
Right! So, right now you are populating the flow panel using this code:
listr = app_tables.list_r.search(tables.order_by('Type',ascending=True))
for i in listr:
self.flow_panel_1.add_component(See_List(item=i), width='30%')
What this is doing is taking the information from the row in your data table and printing it onto the panel – in this case, that is Type and StoreInfo. You’re not actually performing any type of transformation to have those separated into individual items. You can try iterating through each dictionary to print just the values, instead.
However, I don’t think you need to store these items using dicts, as in {"Name": "Berry"}
, for what you’re trying to do there, you can skip all of that and simply store them as a list of strings , unless you want to keep that structure because you’re planning to add more keys into each dictionary later on.
I would also recommend looking through our News Aggregator Tutorial. Even if you’re not intending to build a CRUD app, it really helped me understand how Data Tables and Data Bindings work in Anvil.
I hope that helped!
Gotcha, but If I store them as a list of strings, how would I break them into individual items for the flow panel? I will definitely check out that tutorial and get back to this post if its able to help. Thanks!
Checked the article, unfortunately it only shows how to store and bring back individual rows. I want avoid using tons of rows for what I’m building. Instead each user stores up to certain amount of types, each type is a list of what they need Fruit-Bananas, strawberry’s, melon, ex… and would be stored in one row and broke up on return.
Struggling to find documentation on break up info such as a list of strings or dicts. Thank you for any help you can give.