table references when data source is postgresql

Hi all,

Say I have a table structure like

create table "ParentItem" (
silly_key int primary key,
info1 text,
info2 text,
human_name varchar(255)
);
create table SubItem (
parent_id int references "ParentItem"(silly_key),
val1 double precision,
field1 boolean,
comments text
);

I'd like to create an app wherein users can see a list of items in ParentItem and click on them see the list of SubItems that reference that, together with some stats (min, mean, max) on SubItem.val1. 

I've having trouble getting AppSheets to detect the relationship between ParentItem and SubItem.  It doesn't seem to be able to use the foreign key constraint to know that there is a one-to-many relation.  So I can't get the nifty table references as shown in this demo app https://www.appsheet.com/templates/A-basic-demo-of-table-references?appGuidString=6ffad040-b04a-4325...

What is the "trick" to get table references to work?

0 3 79
3 REPLIES 3

Did you try manually configuring the References between tables - AppSheet Help within AppSheet?

I'm not sure how to follow those instructions, as they reference a dropdown for column type that contains "Ref" but I cannot see any such thing when I go to create a [virtual] column

Steve
Platinum 4
Platinum 4

AppSheet doesn't care about and doesn't use the relationships defined in your database schema. Looks to me you're diving into the deep end (databases) before you've learned to swim (AppSheet basics).

Top Labels in this Space