# How to find decendants?

**URL:** <https://community.glideapps.com/t/how-to-find-decendants/31802>\
**Category:** Ask for Help\
**Created:** [September 15, 2021, 1:19am UTC](https://community.glideapps.com/t/how-to-find-decendants/31802 "2021-09-15T01:19:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Sloan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/peter_sloan/32/29254_2.png) [@Peter\_Sloan](https://community.glideapps.com/u/Peter_Sloan)\
**Post date:** [September 15, 2021, 1:19am UTC](https://community.glideapps.com/t/how-to-find-decendants/31802/1 "2021-09-15T01:19:46Z")

</div>

This image shows an example of the data relationships I have. I’ve used schools to make it easy to visualize.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/6/664a2f6945c6992125b8fbcf45fad2e26c6aea5e.png)  
For any school I can easy show what teachers are at that school e.g for school A1 I would have Bob and Jane.  
What I want to do is if I am at a county level is to get all teachers of that county e.g for county A1 would return the teachers Bob, Jane, James and Derek  
And if I am at the state level it would return all teachers below this state.  
Is there any way to do this?

The only way I can think of doing it is store for each teacher an array of ids that correspond to each level up then when I’m at a state or county level search for all teachers and see if that state or county id exists in the teachers array.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 15, 2021, 1:30am UTC](https://community.glideapps.com/t/how-to-find-decendants/31802/2 "2021-09-15T01:30:01Z")

</div>

I think you should structure your data so each teacher has a State, County, and School column. Every School should have a State and County column. Every County should have a State column. Then it will be easy to relate everything together.

---

<div class="post-metadata">

**Author:** ![Peter\_Sloan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/peter_sloan/32/29254_2.png) [@Peter\_Sloan](https://community.glideapps.com/u/Peter_Sloan)\
**Post date:** [September 15, 2021, 1:38am UTC](https://community.glideapps.com/t/how-to-find-decendants/31802/3 "2021-09-15T01:38:19Z")

</div>

The state, county and schools was just an example. In my application the user is able to create as many levels as they want. It’s just generic tree that can be as big as they want
