Connect records from multiple tables with a one-to-many relationship

Hi guys, forgive the trivial question but I recently started working with appsheet and I can't wait to learn how to use it better.

I need to understand how to create a data structure in which 3 or more tables are linked by a value (ID) in one-to-many relation and when I delete the record of the parent table the records of the other linked tables are also deleted, is it possible?

ES:

Table A:

ID
NAME
SURNAME

Table B:

ID
SPEEDMAX
HR

Table C:

ID
DATE
HR MIN
HR MAX

The Table A -> Table B relationship is one to many and the same as Table A -> Table C

I'll give an example with data

Example.JPG

I obviously created very banal tables.
As you can see the IDs are the same and I would like the records to be closely linked to changes in parent table A.
If I delete the record in table A I would like the records in tables B and C with the same ID to be deleted as well.

Then I would like to understand how to create a view that allows me to join all the tables, therefore having a single table like this:

VIEW.JPG

Thank you very much to anyone who will help me, I'm a beginner but I'm hungry for knowledge.

0 8 231
8 REPLIES 8


@Originws wrote:

when I delete the record of the parent table the records of the other linked tables are also deleted


for this see this.

The view you want is somewhat strange.

A-B correspondence is straight forward but B-C relations are not actually defined by your tables. (i.e how do you know the first row of B should be displayed in the same row as the first row of C?)

 

Thanks for the answer, I looked at the link so the solution to my question is to set the REF type to the ID of table B and select "IsPartOf" to establish a tight dependency with table A (so the child table is a part of the table parent), for table C same thing, I should set ID as REF type and select "IsPartOf" table A.
What could I do for my eyesight? I understand what you mean but how can I connect it to B?

Depending on the relations between B & C.

If B determines C then change the ref col to A to B. B is already connected to A and if you connect C to B then C is also connected to A.

EDIT:(sorry forgot to attach this. https://www.healthline.com/health/how-to-improve-eyesight)

Ok, let me explain better then, table A is the parent and table B and C are the two children. Now having different tables I would need to create a view that combines all the records of the tables (A,B,C) with the same ID. How can I do? In my previous screenshot, when merging the records, some empty cells remain, is this normal? Like table A has only one record, table B has many more.
I would like to group these views by NAME of the customer in table A, so that you click on the customer's name and the view with all the data relating to this user comes out (the view that joins tables A,B,C using the ID )

AppSheet automatically lists corresponding child records regardless of the number of child tables with a parent record. However the view (a detail view) lists everything vertically.

 I believe what you want is to create a dashboard view and display all three tables. Make sure to enable interactive mode. Create one and see for yourself.

Perfect, I don't know the interactive mode of the dashboard view.
I googled and found this example:


https://www.appsheet.com/templates/How-to-make-an-interactive-dashboard?appGuidString=1d06a130-fc0b-...


Do you think this is the right solution for me? Does this solution work even if I have multiple tables not just 3? Because I have simplified the situation but I would have 5 or 6 tables to connect by uniting them in a single view.

https://support.google.com/appsheet/answer/10106384?hl=en#:~:text=Save%20your%20changes.-,configure%...

Official documentation, although needs improvement, is still a must read if you want to familiarize yourself with AppSheet!

Dont't forget!  Each record in your child tables need their own unique id for the row as well...unless you are using RowNumber...but I would advise against this.

scott192_0-1697732590424.png

 

Top Labels in this Space