Filtering JSON export

I just try to export a json file using filters to select data I want to export but whatever I do it seems to export the whole database.

Is it me or this export don’t do what I want ?

(Please include your Gramps version and Operating System: GrampsAIO64-5.1.1-1 @Windows 10)

I assume you have the filter set for People.

In any export there is a built-in Reference Filter. The default is to “Include all selected records”. Set this filter to “Do not include records not linked to a selected person”. With this setting, only those places, sources, citations, etc that relate to the people/families of the filter will export.

This is the same configuration for all exports.

1 Like

The filter i used in export window is the same than person filter, “do not include records…” is set too but my full database is exported.

This is my export filters:

As you can see, filtering results are the same in persons view and in export window but the json file contains my full db: 8546 persons as notepad++ told me when counting them:
image

Some troubleshooting:

What happens in an XML (.gramps) export? Or any of the other exports available. Import them back into Gramps to confirm the expected number of records.

Obviously the more info that can isolate where the problem resides will help those who know the code.

As a short term workaround, take the XML backup and after importing to a knew database, perform the JSON export on that complete database.

The JSON export with filter doesn’t work because the author forgot to add the lines:

        if option_box:
            self.option_box.parse_options()
            db = option_box.get_filtered_database(db)

near the top of the exportData routine (before line 36).

You might want to tell us what you expect the JSON export to do for you; this was an experimental diagnostic plugin, which I expect few people can really use.

1 Like

I’m trying to play with tools as pandas. Just tests.

for future readers of this post, what you have to change is this (no self):

if option_box:
    option_box.parse_options()
    db = option_box.get_filtered_database(db)

thanks again @prculley

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