Imagine I have database tables:
customers, with columns customerId, firstName, lastName
products, with columns productId, name, description
orders, with columns customerId, productId, quantity
Now I have a listView of customers (customerListView), and within that a nested listView (orderListView) with information about the products ordered by that customer.
Based on the section on nesting in Build custom views using repeatable components | Retool Docs I thought I'd be able to write backing queries:
select * from customers
and
select p.productId, p.name, p.description, o.quantity
from orders o
inner join products p
on o.productId = p.productId
where o.customerId = {{ customerListView.item.customerId }}
However this doesn't seem to work. The autocomplete doesn't even suggest customerListView.item
. Am I doing something wrong? Is there some other way to achieve this?