Role in event entry

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.

1 Like

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 (an addon) will help you manage all your custom entries.

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.

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.

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.

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.

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.

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)

They should not disappear.

Try running the Type Cleanup tool to rebuild the list.

1 Like

I already tried it never worked

1 Like

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. 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.

2 Likes

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” builds a Selector with a current Role list using the following lines:

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

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.

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

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

A standard .gramps backup file, manually or automatically made

1 Like

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

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.

    <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”.

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

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?