# How to get list of persons with their national ID

**URL:** <https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094>\
**Category:** Help\
**Created:** [October 7, 2026, 5:27pm UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094 "2026-10-07T17:27:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcsaaver](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jcsaaver/32/471_2.png) [@jcsaaver](https://gramps.discourse.group/u/jcsaaver)\
**Post date:** [October 7, 2026, 5:27pm UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094/1 "2026-10-07T17:27:28Z")

</div>

Hello!

I would like to get a list of all the persons having a national ID number in their attributes.

I need name + national ID number.

Any ideas?

(Gramps 6.0.8, Ubuntu 24.04)

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [October 7, 2026, 7:44pm UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094/2 "2026-10-07T19:44:37Z")

</div>

What is a “National ID” and where have you stored that data?

---

<div class="post-metadata">

**Author:** ![jcsaaver](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jcsaaver/32/471_2.png) [@jcsaaver](https://gramps.discourse.group/u/jcsaaver)\
**Post date:** [October 7, 2026, 11:37pm UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094/3 "2026-10-07T23:37:34Z")

</div>

The national ID number is a number that identifies every citizen in a country. Is like the social security number from the USA.

I stored that data as a personal attribute.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [October 8, 2026, 12:53am UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094/4 "2026-10-08T00:53:34Z")

</div>

Ok. Then you want to use a Custom Filter in the People category for that Person custom Attribute. (I searched for people with FindAGrave IDs. You would select whatever label you used for the National ID.) Use the Regular Expressions (RegEx) `\S*` string value to search for ones that have content. (That is, they are not blank.)

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/5/53be4744cfb42cd1809fabedb653732ffbe66f51.png)  
Uses the following **People** category `General filters` rule:  
[People with the personal `<attribute>`](https://gramps-project.org/wiki/index.php?title=Gramps_6.0_Wiki_Manual_-_Filters#People_with_the_personal_.3Cattribute.3E)

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/f/fc86aefb9578ca5cd91f35965b8d3ce0b3b8e129.png)

But this just gives you a view with a list of People that _ **have** _ a FindAGrave ID. You could export the view as a list but since there is no column for the National ID, the export would not include that data either.

And there is no Report for collation of People with certain Attributes.

You will need to make a simple script with that output. (You could use any of the Python/SQL plugin tools or gramplets that can do database queries. I will use the [SuperTool addon from the Isotammi group](https://gramps-project.org/wiki/index.php/Addon:Isotammi_addons#SuperTool) because there are [example scripts about Attribute searching](https://gramps.discourse.group/t/using-attributes-for-searchable-ids/9004) to adapt.

After applying the Custom Filter, I selected the persons of interest (because I will tell SuperTool to just list the names and the Attribute for the selected persons) and ran Tools → Isotammi tools → SuperTool.

The script only has a few lines. You just need to substitute in the EXACT way your National ID attribute is labeled in the `ATTR_TARGET = "FindAGraveID` line.

```python
[Gramps SuperTool script file]
version=1

[title]
Social Security Number Attributes

[description]
Show names and Social Security Number attribute values

[category]
People

[initial_statements]
ATTR_TARGET = "Social Security Number"

[statements]
ssn_list = [val for name, val in attributes if name == ATTR_TARGET]
ssn_val = ssn_list[0] if ssn_list else None

[filter]
ssn_val is not None

[expressions]
name, ATTR_TARGET, ssn_val

[scope]
selected

```

When I Execute the script, the list of names and Attribute values appears in the **Results**. And the **Results** list can be output to CSV or copied to your clipboard with a click of the Download CSV or Copy button.

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/5/50391a2820dbe1ccdc68503f0eac56b59f12c009.png)

---

<div class="post-metadata">

**Author:** ![jcsaaver](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jcsaaver/32/471_2.png) [@jcsaaver](https://gramps.discourse.group/u/jcsaaver)\
**Post date:** [October 26, 2026, 4:41pm UTC](https://gramps.discourse.group/t/how-to-get-list-of-persons-with-their-national-id/10094/5 "2026-10-26T16:41:21Z")

</div>

Thanks @emyoulation.  
It worked just as described.

I leave here a couple of problems I had when trying to implement it, becouse it might be helpful to someone:

First, to install the Isotammi Super Tool, in the Plugin Manager you have to select “Expert” instead of “All audiences” in the penultimate box.

Second, in order to search for an attribute, you have to use its original English form, not its translation. in my case, I had to use “Identification Number” instead of “Número de identificación”.
