# Filter on selected person in the people view

**URL:** <https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432>\
**Category:** Help\
**Created:** [May 6, 2021, 7:23pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432 "2021-05-06T19:23:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugene](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/eugene/32/1911_2.png) [@eugene](https://gramps.discourse.group/u/eugene)\
**Post date:** [May 6, 2021, 7:23pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432/1 "2021-05-06T19:23:28Z")

</div>

Hello all,  
My first question on this list.

Is it possible to create a filter on ancestors of, descendants of etc based on the currently selected person in the peoples list?

At the moment you have to select an Id to do this. It would be great if this Id would automatically be filled with the current selected person.

Thank you very much,  
Eugene Dubois

(Gramps version 5.1.3 on Linux Mint)

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [May 6, 2021, 7:49pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432/2 "2021-05-06T19:49:18Z")

</div>

Welcome

Yes, it can be done and I find it very helpful. The problem is that the filter rule only works in the flat People view and not in the Grouped People view so has not been made an automatic installed third party addon.

You can find the code here (and other discussion about it).

> [@Custom filters based on currently selected person(s)](https://gramps.discourse.group/t/custom-filters-based-on-currently-selected-person-s/354/9):
>
> I have created the ActivePerson filter rule [https://github.com/gramps-project/addons-source/pull/306](https://github.com/gramps-project/addons-source/pull/306) if any of our more adventurous users wants to try it. I will probably wait a few days to see if there are any comments before making it available for everyone via the usual addons update.

Take the two files (activepersonrule.gpr.py, and activepersonrule.py) and place them in your user plugin directory. Your [user directory](https://gramps-project.org/wiki/index.php/Gramps_5.1_Wiki_Manual_-_User_Directory) will have a version directory and plugin subfolder (\gramps51\plugins). If you have a folder FilerRules you can put the files there or create the folder.

To actually use the filter, after restarting Gramps, create a filter rule with just this new filter rule in it. Then from the filter you actually want to reference the active person, instead of the rule based upon a static person, set the filter to reference this new active person filter rule. ie `Ancestors of <filter> match`

---

<div class="post-metadata">

**Author:** ![eugene](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/eugene/32/1911_2.png) [@eugene](https://gramps.discourse.group/u/eugene)\
**Post date:** [May 6, 2021, 8:14pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432/3 "2021-05-06T20:14:14Z")

</div>

> [@DaveSch](#):
>
> filter rule with just this new filt

Hello Dave,

That’s great!  
I think I will be using this a lot.

Eugene

---

<div class="post-metadata">

**Author:** ![prculley](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/prculley/32/41_2.png) [@prculley](https://gramps.discourse.group/u/prculley)\
**Post date:** [May 7, 2021, 2:19pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432/4 "2021-05-07T14:19:23Z")

</div>

The rule is now available for install via the normal addon install process. But it only works on Person Tree view with 5.1.3 and newer versions of Gramps. It does work on Person flat view in older versions.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [June 6, 2021, 2:19pm UTC](https://gramps.discourse.group/t/filter-on-selected-person-in-the-people-view/1432/5 "2021-06-06T14:19:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
