# Associating children to parents from parent's detailed view?

**URL:** <https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131>\
**Category:** Ask for Help\
**Created:** [January 13, 2021, 6:24pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131 "2021-01-13T18:24:57Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 13, 2021, 6:24pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/1 "2021-01-13T18:24:57Z")

</div>

Is it possible to associate children with parents from the parent item’s detailed view?

I have a Parent has many Children relationship between two tables. In the detail screen of Parent items I have an inline list showing all the children related with the parent.

Is there an option or a workaround to allow users to be able to link children with parents from the parent item’s detailed view?

I am thinking about the possibility of adding an ‘Add Child’ button below the inline list. That button would open a screen (form?) showing the full list of children and then when I click on an item it should associate the child item with the parent item and go back to the parent item’s detailed view.

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [January 13, 2021, 6:33pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/2 "2021-01-13T18:33:34Z")

</div>

Hola @gusa ,

It is posible. Make sure that in your “Log sheets/table” you are also registering the parent’s ID. Then use a relation to bring such info to the parent screen.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 13, 2021, 6:54pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/3 "2021-01-13T18:54:34Z")

</div>

Yes. I imagine you’d use the inline list of all children \> view Details \> add a button that has a compound action:

1. **Set column** action to assigned the “Parent ID” to the User’s Parent ID from the User Profile sheet.
2. **Show notification** action of “child assigned”
3. **Go back** action

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 1:09pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/4 "2021-01-14T13:09:19Z")

</div>

Thank you. Quick question, how do I register the parent’s ID in the User Profile table?

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [January 14, 2021, 1:28pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/5 "2021-01-14T13:28:27Z")

</div>

A way to Natively do this is to create a RowID in the Glide Editor.

What do you think @Robert_Petitto ?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 14, 2021, 1:45pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/6 "2021-01-14T13:45:40Z")

</div>

Either you create a rowID column or on your onboarding experience, set a unique identifier to a unique ID column.

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 1:45pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/7 "2021-01-14T13:45:59Z")

</div>

I might be way off, but my working hypothesis right now is that you and @SantiagoPerez are utilizing the User Profiles table as a place to store session variables. In my example, I would use it to store the Parent ID at some point of the flow so it can be assigned to the Child’s Parent ID field deeper in the flow.

Am I missing it completely?

---

<div class="post-metadata">

**Author:** ![profechef](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profechef/32/221_2.png) [@profechef](https://community.glideapps.com/u/profechef)\
**Post date:** [January 14, 2021, 2:15pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/8 "2021-01-14T14:15:48Z")

</div>

I’ve done something similar in [this app](https://tareasescolares.glideapp.io/)  
[Tareas escolares](https://tareasescolares.glideapp.io/).  
When a student logs in, the app ask for parents email. Then a parent logs in and in the Gsheet I use “vlookup” to find which student has registered that email. The column “correo alumno” (student email) has always the student email. It’s the same as “correo usuario” (user’s email) if user is a student or the one vlookup calculates if it’s not.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/a/0a1a1ab778564a40db1932b2895b29897a582a28.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/c/cc5491f7188a06160f4074d5f47c3b0c28d6d84a.png)

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 2:58pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/9 "2021-01-14T14:58:29Z")

</div>

(This is fascinating because it gives me an idea for another app that I have in mind related with a gamified app for parents and kids that allows parents to give awards to their kids when they sleep all night long in their rooms.)

However, let me reformulate my question because I might be wrong but I think that your answer is not related to my question.

Let’s say that I want to model an admin app for science clubs where I have students that form groups and their work is organized in activities.

Activities have a starting date and an end date and they are assigned to sub-groups from the main group.

I’d like to have a tab showing Activities grouped by Group. Then, when I click on an Activity I want to see the details including an inline list with the students assigned to the Activity.

From this detailed view, I want to be able to select students from the main group and add (assign) them to the Activity. (I also want to remove them from the Activity, but I already solved the problem.)

In order to do that I created a tab listing the Activities (grouped by Group). Then (for the sake of giving more context to this explanation) in the Activities \> detail view screen I have an inline list with the students assigned to the Activity. Then I want to either show a list of students in the Group so I can assign them to the Activity being displayed, or have a button that takes me to a screen containing the list of students in a Group.

In either case, I want to be able to select an item from the list and trigger an action that assigns the student to the parent Activity (either the one being showed or the one from the previous screen).

How can I access the parent Activity’s ID from the inline list of students so that I can assign it to the student’s Activity?

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [January 14, 2021, 3:15pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/10 "2021-01-14T15:15:15Z")

</div>

Would you mind giving us a few screenshots/video of how you have everything set up?

If I’m understanding correctly you want to bring the ID from the category tab. For that I’d use a relation on the activities tab that matches the category in that tab to the category in the other tab. The a lookup to the the ID so you can be able to use it later.

Let us know if this is what you’re looking for.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 14, 2021, 3:58pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/11 "2021-01-14T15:58:44Z")

</div>

Can student’s be involved in more than one activity?

---

<div class="post-metadata">

**Author:** ![profechef](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profechef/32/221_2.png) [@profechef](https://community.glideapps.com/u/profechef)\
**Post date:** [January 14, 2021, 4:52pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/13 "2021-01-14T16:52:03Z")

</div>

I agree with @SantiagoPerez Perhaps with a screenshot I could understand better what you need.

All students in subactivity A1 are assigned to activity A?

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 5:43pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/14 "2021-01-14T17:43:30Z")

</div>

Let’s say no.

---

<div class="post-metadata">

**Author:** ![profechef](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profechef/32/221_2.png) [@profechef](https://community.glideapps.com/u/profechef)\
**Post date:** [January 14, 2021, 6:38pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/15 "2021-01-14T18:38:40Z")

</div>

In [this app](https://moving-tongue-0071.glideapp.io/) you can assig a student to an activity (no subactivity) or assign a student to both a subactivity and its parent activity.  
It’s made with relations to a unique row in an aux sheet. If this is what your are looking for I can show some screenshots

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 6:56pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/16 "2021-01-14T18:56:49Z")

</div>

I think this is very similar to what I am trying to solve. Maybe I am overcomplicating things because I am new to this Glide!

Please do share some screenshots! Where can I learn more about these auxiliary structures to store user session data?

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 14, 2021, 7:30pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/17 "2021-01-14T19:30:00Z")

</div>

This is how I would have approached it as well…well done @profechef.

---

<div class="post-metadata">

**Author:** ![profechef](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profechef/32/221_2.png) [@profechef](https://community.glideapps.com/u/profechef)\
**Post date:** [January 14, 2021, 8:12pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/18 "2021-01-14T20:12:36Z")

</div>

I have a sheet “Aux” with only one row. The A0 is the code used in the relations. Columns “Actual Activity” and “Actual Subactivity” are used to store the activity and subactivity that are been watched by the user.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/d/1da36b6dd6e6427ebb2786f2b61c0ba78a3dc7c5.png)  
Activity’s tab has column filled by an array formula with “A0”.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/9/29f9152c670d5348c9620645342873e54bc03c7d.png)  
This column is used to make a relation with “Aux”  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/b/0ba34aa34da25b100764aa97a91af719b5e260b7.png)  
Activity’s list action is composed. First it sets Actual Activity in Aux sheet with Activity’s code. Then View details  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/e/deb6a3400dd2629be61508b2af83fe1ad0cd6722.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/1/71dcaf19ca93a02e99e4ad46554d4ad256703aa2.png)

Students’ tab also has a relation with A0 row and the students’ list also has a compound action, which sets Student activity with Actual activity in aux.

All this is replicated in Subactivities tab. In this case the compound action sets activity and subactivity student columns.  
You can copy the app and [its google sheet](https://docs.google.com/spreadsheets/d/14DBgRnMWZg6jqz9A0C4lX6e-ncY4VyEYXgrO1RRchM4/edit?usp=sharing)

---

<div class="post-metadata">

**Author:** ![gusa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gusa/32/19778_2.png) [@gusa](https://community.glideapps.com/u/gusa)\
**Post date:** [January 14, 2021, 8:52pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/19 "2021-01-14T20:52:43Z")

</div>

@Robert_Petitto @SantiagoPerez @profechef I think I made it with all your help!

Let me try to explain it briefly.

**Step 1**

I created an (auxiliary) Glide table named `Session` with one row and the following column specification.

- `ID`: Template field with the value “1”
- `Session User ID`: User specific field
- `Session Activity ID`: User specific field

**Step 2**

I added the following fields in the Users table.

- `Session ID`: Template field with the value “1”
- `Session`: Relation column to the `Session` table
- `Session Activity ID`: Lookup field that I’m using use later to link the student with the activity.

**Step 3**

I added the following fields in the Activities table.

- `Session ID`: Template field with the value “1”
- `Session`: Relation column to the `Session` table

I needed this step to be able to have access to the `Sessions` table from an Activity entity in a `Set columns` action (see **Step 5** below).

**Step 4**

I created an empty tab (source Users) to list all the activities. (I needed to create a tab from scratch because the predefined tab for Activities doesn’t allow me to select the list and add a custom action.)

**Step 5**

I added an inline list of Activities to the new tab. Then I created a new compound action for the inline list with the following steps.

1. Set columns action. In the table Session sets `Session User ID` = `User.Row ID` and `Session Activity ID` = `this.Row ID`
2. View details action. Let the flow to move forward.

With such a mechanism in place I am able to ‘save’ the current Activity ID ‘globally’ (within the scope of the user’s session) just before I open an Activity.

**Step 6**

In the Activity detailed view I added an inline list of students associated with the current activity. Then I added a second inline list with all the students. The latter is the list I’m going to use to assign students to the former list.

**Step 7**

In the list of all students I added a ‘Set columns’ action that assigns the lookup field `Session Activity ID` in the `Users` table (previously saved in **Step 5** ) to the student’s Activity ID.

I think that’s more or less what I did.

Some notes:

- Fields `Session User ID` and `Session Activity ID` are user specific in order to avoid messing up with other user sessions.
- I created the table `Session` as a Glide table I don’t know why, but guts tell me that it’s cleaner than having it as a sheet.
- The field `Session ID` in `Users` and `Activities` tables is a template because I don’t know a better way to set a ‘read-only’ field with a default value. Since it’s a template field it’s nice that it lives in the memory.

Thank you so much for your help. I will keep learning and iterating these ideas over.

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:58pm UTC](https://community.glideapps.com/t/associating-children-to-parents-from-parents-detailed-view/21131/20 "2024-01-17T16:58:25Z")

</div>


