# Role in event entry

**URL:** <https://gramps.discourse.group/t/role-in-event-entry/2834>\
**Category:** Ideas\
**Created:** [October 6, 2022, 9:29am UTC](https://gramps.discourse.group/t/role-in-event-entry/2834 "2022-10-06T09:29:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tinkerbelle](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tinkerbelle](https://gramps.discourse.group/u/Tinkerbelle)\
**Post date:** [October 6, 2022, 9:29am UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/1 "2022-10-06T09:29:51Z")

</div>

When adding events there is a preset list of roles that can be added and for some users that list may be sufficient. If a user wants to increase the usability of their information then they can add new roles to the list just by manually typing a role in the form.

This works as expected but with one problem. On every restart of Gramps the list is randomly reordered, I can see no logic in the reordering, it does not arrange the list alphabetically, or in the order of adding entries or by usage frequency. My list of roles is so long I need to scroll a lot to find the one I need.  
It would be preferable if the list was presented consistently, alphabetically may be the best option but I am not sure if anyone will suggest something better.

---

<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:** [October 6, 2022, 10:38am UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/2 "2022-10-06T10:38:11Z")

</div>

When selecting the role for a new event, if you start typing in the role list the list will start filtering. This works in all drop-down lists. Just be careful that you do not add another entry, one you do not actually want.

The [Types Cleanup Tool](https://gramps-project.org/wiki/index.php/Addon:Types_Cleanup_Tool) (an addon) will help you manage all your custom entries.

---

<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 6, 2022, 11:38am UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/3 "2022-10-06T11:38:25Z")

</div>

> [@Tinkerbelle](#):
>
> My list of roles is so long I need to scroll a lot to find the one I need.

Could you describe what kind of roles you are creating?

It could be that you might be putting data in somewhere that it won’t be actionable. It might be more suited to another data bucket.

The types Roles are intended to be broad and require a short list. Too much granularity might be undermining your future reports & export.

---

<div class="post-metadata">

**Author:** ![Tinkerbelle](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tinkerbelle](https://gramps.discourse.group/u/Tinkerbelle)\
**Post date:** [October 6, 2022, 12:45pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/4 "2022-10-06T12:45:47Z")

</div>

Most of the roles are for census entries, more than are supplied as standard. I also have lots of legal documents in which family members are listed as lawyers or executors of wills or accountants for trust funds, these all show the important connections between ancestors, such as one minister who performed religious services for several dozen relatives.  
This is not causing any problems with reports or exports but is slowing data entry.

---

<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 6, 2022, 1:56pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/5 "2022-10-06T13:56:21Z")

</div>

I try to limit the census roles: the head of household is the Primary and others are Dependents. (while they may not qualify by a taxman’s definition, they are dependent on the Primary for their living space) – the family relationship’s may be inferred from the tree… so keying in that data is redundant. And there is a field in the census to record that relationship anyway.

As for the legal forms, I prefer some broader, more re-usable categories. Officiant, Primary & Witness can be used without needing to define which profession.

---

<div class="post-metadata">

**Author:** ![Tinkerbelle](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tinkerbelle](https://gramps.discourse.group/u/Tinkerbelle)\
**Post date:** [October 6, 2022, 2:39pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/6 "2022-10-06T14:39:20Z")

</div>

I guess everyone has their own system.

I prefer to use the information obtained from census images, rely on others to infer anything is risky so adding the role as described is far from redundant.

I am not sure what you mean by “there is a field in the census to record that relationship anyway” the only place I see is the role, or maybe I am looking in the wrong place.

---

<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 6, 2022, 3:32pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/7 "2022-10-06T15:32:53Z")

</div>

> [@Tinkerbelle](#):
>
> I am not sure what you mean by “there is a field in the census to record that relationship anyway” the only place I see is the role, or maybe I am looking in the wrong place.

Just checked the Forms documentation and see what you mean. (The aesthetics of form data seems a bit primitive so I’ve only used this tool when experimenting with the example tree.)

But the main reason for sticking to the “Primary” or “Family” roles is that Reports tend to have features that interpret those built-in roles better than Custom Roles.

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [October 6, 2022, 3:41pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/8 "2022-10-06T15:41:46Z")

</div>

Does someone know where that list of roles is stored?

My own entries disappears after creating a new database and reloading backup file.

Does any tool exist to regenerate it (them because it’s the same for personal place types)

---

<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:** [October 6, 2022, 3:53pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/9 "2022-10-06T15:53:28Z")

</div>

> [@PLegoux](#):
>
> My own entries disappears after creating a new database and reloading backup file.

They should not disappear.

Try running the [Type Cleanup tool](https://gramps-project.org/wiki/index.php/Addon:Types_Cleanup_Tool) to rebuild the list.

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [October 6, 2022, 5:23pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/10 "2022-10-06T17:23:13Z")

</div>

I already tried it never worked

---

<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:** [October 6, 2022, 8:09pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/11 "2022-10-06T20:09:15Z")

</div>

There is the tool **Rebuild Secondary Indexes** under **Family Tree Repair**. Not sure what it is actually doing and if it would solve the problem. No wiki information on it other than how to run it from the [command line](https://gramps-project.org/wiki/index.php/Gramps_5.1_Wiki_Manual_-_Command_Line#tool_action_option). Maybe the actual code will tell you more.

When I am doing a routine Check & Repair etc (every 6-8 months) I’ll include the rebuild tools. It cannot hurt.

---

<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, 2022, 1:05am UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/12 "2022-10-07T01:05:40Z")

</div>

Try making a Custom Filter with the Person category with the Event filter rule: “`People with events with the <role>`”. (There is a corresponding Event filter rule for the Family category. But it builds the same list.) Is this selector list more complete than the list you see in when editing Events?

Maybe you can do some experiments with SuperTool. Here’s a starting point.

The core plugin Person category rule “[`hasrolerule.py`](https://github.com/gramps-project/addons-source/blob/master/FilterRules/hasrolerule.py#L46)” builds a Selector with a current Role list using the following lines:

```auto
class Roletype(MySelect):
    """ Provide a Role type selector """
    def __init__ (self, db):
        MySelect. __init__ (self, EventRoleType, db.get_event_roles())

```

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [October 7, 2022, 3:19pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/13 "2022-10-07T15:19:05Z")

</div>

> [@PLegoux](#):
>
> Does someone know where that list of roles is stored?

I think they are stored in a blob column called “value” in the database table called “metadata” in the row where the column called “setting” is equal to “event\_roles”.

I don’t think unused roles are exported (not even by the SQLite Export addon) so if you start a new empty database they would be lost.

---

<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:** [October 7, 2022, 3:46pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/14 "2022-10-07T15:46:12Z")

</div>

> [@PLegoux](#):
>
> My own entries disappears after creating a new database and reloading backup file.

What type of Backup file? XML .gramps, GEDCOM ??

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [October 7, 2022, 3:47pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/15 "2022-10-07T15:47:07Z")

</div>

> [@GeorgeWilmes](#):
>
> I don’t think unused roles are exported (not even by the SQLite Export addon) so if you start a new empty database they would be lost.

My problem is user defined used roles are not reimported in the blob when I create a database from a backup.

So, I can see them in events where they are used but not in the role list when I add or share an event

---

<div class="post-metadata">

**Author:** ![PLegoux](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/plegoux/32/413_2.png) [@PLegoux](https://gramps.discourse.group/u/PLegoux)\
**Post date:** [October 7, 2022, 3:48pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/16 "2022-10-07T15:48:04Z")

</div>

A standard .gramps backup file, manually or automatically made

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [October 7, 2022, 4:00pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/17 "2022-10-07T16:00:33Z")

</div>

I think the XML file contains only the values that are actually used by any events in the database.

---

<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:** [October 7, 2022, 5:38pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/18 "2022-10-07T17:38:49Z")

</div>

I recently created another tree from a backup (XML .gramps) so I could build a NarrWed for a cousin.

All custom roles from my master file are present in the new database. I did not use any of the tools I suggested above.

Just for fun, I uncompressed my most recent backup and went searching for a custom role.

```auto
    <person handle="_cb13a2bc7f627c605de" change="1664400628" id="G163190">
      <gender>M</gender>
      <name type="Birth Name">
        <first>Rodney A</first>
        <surname>Thompson</surname>
      </name>
      <eventref hlink="_cb13a23d15e4b4fe6eb" role="Primary"/>
      <eventref hlink="_cb13a2b8c82291a6298" role="Grandnephew"/>
      <childof hlink="_cb12d545ce6124becf2"/>
      <tagref hlink="_eecac4884c45aa2c1c74666492d"/>
    </person>

```

I checked the new tree I just created and Rodney has the census event where he is a “Grandnephew”.

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [October 7, 2022, 7:05pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/19 "2022-10-07T19:05:49Z")

</div>

> [@GeorgeWilmes](#):
>
> I think they are stored in a blob column called “value” in the database table called “metadata” in the row where the column called “setting” is equal to “event\_roles”.

For what it may be worth, here are the other values of the “setting” column in the “metadata” table in the Gramps “example” database:

bookmarks

child\_refs

citation\_bookmarks

cmap\_index

default-person-handle

eattr\_names

emap\_index

event\_bookmarks

event\_names

event\_roles

family\_bookmarks

family\_rels

fattr\_names

fmap\_index

lmap\_index

marker\_names

mattr\_names

media-path

media\_bookmarks

name\_formats

name\_types

nmap\_index

note\_bookmarks

note\_types

omap\_index

origin\_types

pattr\_names

place\_bookmarks

place\_types

pmap\_index

repo\_bookmarks

repo\_types

researcher

rmap\_index

sattr\_names

sm\_types

smap\_index

source\_bookmarks

url\_types

version

---

<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:** [October 7, 2022, 8:24pm UTC](https://gramps.discourse.group/t/role-in-event-entry/2834/20 "2022-10-07T20:24:02Z")

</div>

Another question to help narrow the issue.

Do any of the other drop-down lists have the same behavior, i.e. not adding the user’s custom entries when imported?

It used to be, pre Type Cleanup tool, that to remove a no longer needed/used custom type was to do a clean import from the Gramps backup. That the no longer used custom type, not present on any record, would not be added to @GeorgeWilmes metadata blob.

Is this isolated to event\_roles or are other Types affected?

[Next page](https://gramps.discourse.group/t/role-in-event-entry/2834.md?page=2)
