Attach a child table to a record of another table

I would like to create a child table that is owned by a record of a parent table such that for each record of the parent table it has it’s own copy of the data in the child table. For example let’s say I have a Game table. Each row (record) of the Game table represents an instance of a game with the game parameters in the record. Each game record also needs a points table that can be edited for each Game record. For example:
Offset Points
-4 6
-3 5
-2 4
-1 3
0 2
1 1
2 0
3 0
ect.

How would you go about implementing this behavior in Appsheet?

Thanks,
Steve

0 10 541
  • UX
10 REPLIES 10

You’re speaking in reference terms, but are you aware you can connect tables together with reference in AppSheet?

Yes I know about references. I know a row in one table can reference (and own using “is part of”) a row in another table but I want a row to own another table so that when a row is added in another table it creates another copy of the table it references. It’s almost like a 3D table. Is this possible somehow?

Steve

So you want to copy data from one table to another; you’ll end up with copies of copies of copies…Such data-duplication is a bad idea.

No, I don’t want to copy data. I want to have a row in one table that owns an instance of another table with different data.

Here is the structure I want
Col 1 Col 2 Col 3 Col 4
Row 1: val1 val2 -4 5
-3 4
-2 3

Row 2: val1 val2 -2 4
-1 2
0 0

So Table 1 has the rows Row1 and Row 2. I was thinking that Col 3 and Col 4 could be a separate table and could be edited along with each row added.

I suppose I could create child rows but I would need about 15 child rows per row added. It seems cumbersome.

Steve

Yes.

How?

The app itself cannot create tables; the app editor must be used to create tables. To have something akin to a new table, you’d have to use slices, security filters, and/or partitions to display data in an existing combined table as a distinct table.

Rows of one table do not “own” rows of any table. Your use of this term is confusing.

Your examples aren’t clear.

Can you give us a concrete idea of what your app is for? And why you need these tables of tables?

Let me explain a little better. I have 2 tables. Table 1 is a table of game parameters in which each record represents a game being played. I have another table (Table 2) of weighting points which are used for every game being played which looks like the following:

Offset Points
-4 6
-3 5
-2 4
-1 3
0 2
1 1
2 0
3 0

The problem is that I want to have each game being played (Table 1 record) to have it’s own set of weighting points (Table 2) that can be set when a new game is added in Table 1. Currently, all games being played have to access the same table of points (Table 2). So, if one game changes the points table they get changed for all games being played. This is not the behavior that I want. I want to have each game (a record in Table 1) to have it’s own set of weighting points.

Table 2 would need an additional column to store the game (a Ref to the row in table 1) with which each row of table 2 is associated. When you need a row from a particular game’s set of table 2 rows, you would need to look only at those table 2 rows that reference the appropriate game in table 1. In effect, the rows of table 2 would be “child” rows to the “parent” row in table 1. This is what @MultiTech_Visions was getting at with his help doc suggestion, above. You could use slices to make is easier to focus on only one game’s set of table 2 rows.

The next challenge is automatically creating the set of rows in table 2 for each (new) row in table 1. These posts might provide some guidance:

Thanks Steve!!! The first example worked great. I appreciate your quick response!

Steve

Top Labels in this Space