# DMS in Appfarm (follow-up)

**URL:** <https://community.appfarm.io/t/dms-in-appfarm-follow-up/978>\
**Category:** Ask the community\
**Created:** [January 14, 2024, 11:58pm UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978 "2024-01-14T23:58:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/ryan/32/1279_2.png) [@Ryan](https://community.appfarm.io/u/Ryan)\
**Post date:** [January 14, 2024, 11:58pm UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978/1 "2024-01-14T23:58:40Z")

</div>

Hi everyone!

I am in the midst of implementing a DMS. Right now we have something in place with the help of the suggestions in this post ([DMS in appfarm (Document Management System)](https://community.appfarm.io/t/dms-in-appfarm-document-management-system/757)).

However, I have a use case where on clicking a parent, I want to hide all the children/grandchildren/great-grandchildren and so forth, however many levels are present. It is straightforward enough to do it for children, but how would I go about doing it recursively for the deeper levels?

Thank you!

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [January 15, 2024, 5:39am UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978/2 "2024-01-15T05:39:53Z")

</div>

Hello!

I believe you have seen the [recursive tree](https://docs.appfarm.io/library/ui-components/container#custom-lists) feature? If you want to toggle all direct children of clicked item (i.e. object in context) collapsed, you may update all objects having object in context as parent. If you want to toggle a more advanced selection - see if the context parameter “iteration level” might help.

---

<div class="post-metadata">

**Author:** ![Ryan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/ryan/32/1279_2.png) [@Ryan](https://community.appfarm.io/u/Ryan)\
**Post date:** [January 15, 2024, 2:48pm UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978/3 "2024-01-15T14:48:40Z")

</div>

Hi! thanks for the update. I have no issues hiding the direct children. But I need to hide all of the descendants, not just the direct children. Any ideas on how I could do so?

---

<div class="post-metadata">

**Author:** ![Ryan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/ryan/32/1279_2.png) [@Ryan](https://community.appfarm.io/u/Ryan)\
**Post date:** [January 17, 2024, 2:01pm UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978/4 "2024-01-17T14:01:03Z")

</div>

@kristian @rhys Hi, would you have any thoughts on this? Would appreciate any input you have.

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [January 17, 2024, 3:17pm UTC](https://community.appfarm.io/t/dms-in-appfarm-follow-up/978/5 "2024-01-17T15:17:47Z")

</div>

I’m thinking one of the following, depending on the desired behaviour.

a) If you have a list of Categories, with a “indefinite” set of Subcategories. When clicking the “Collapse” button on Subcategory 1.1 → Save the Context Parameter `Recursion level` as a runtime property (e.g. `Selected recusion level`). On the container for the row/category, make it Visible only if the Recursion level for that object is greater than or equal `Selected recursion level`  
b) Having a runtime property for all Categories (e.g. “Is Hidden”), perform an advanced Update Object when selecting the parent. You may update all Categories and set the “Is Hidden” flag with a Function where you add categories (all) as a function parameter as well as the ID of the object in context, and perform a depth-first search to evaluate if that Category should be hidden.  
c) Same as B, but with a while-loop propagating from the parent, down the “tree” to set all children and grandchildren hidden until the whole familiy is hidden.
