Viewing linked row object in Repeating Panel

What I’m trying to do:
I have a column called productModel in a table that is linked to another table called products that has two columns called product_number and product_name. When I call this table in a repeating panel it displays
<LiveObject: anvil.tables.Row>
instead of the data

I guess essentially what I want is two “inner columns” inside the productModel column for product_number and product_name from the products table.

I’m not really sure how to go about doing this?

What I’ve tried and what’s not working:

Code Sample:

 self.repeating_panel_1.items = app_tables.verifiedregistrations.search() ``` 

Clone link:
share a copy of your app

After setting up the repeating panel, you need to handle each row in the repeating panel’s item template. You can then have the connected table be handled with a repeating panel and another item template within the first repeating panel. You can see what I mean with this clone link:

1 Like

Super helpful thanks!
The only issue I’m having now is that in the ItemTemplate2 form, when I set the label text to be column name such as:
self.product_name.text = self.item["product_name"]
It’s returning the error that a list index cannot be a string
I can of course input the index of the column as

self.product_name.text = self.item[0]

But this outputs something like:
product_name Saw

Do I need to try a tuple maybe?

Whatever you’re passing into that second template doesn’t look like a linked row to Anvil. If you show how you’re populating that second repeating panel, and the structure of your data tables, that would help narrow it down.

1 Like

As a quicker test, you can add these two lines before the assignment:

print(self.item)
print(dict(self.item))
self.product_name.text = self.item[0]

The first line will tell you what self.item is.
The second line will show its content if it is a dict (or something compatible to a dict, like a row object), or crash if it is not.

1 Like

These days, we can also set breakpoints, and inspect variables!

But print() is often a lot simpler to use.