* Running Multiple Queries from a Plugin & Saving Results to Named Lists

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
martinpbudd
Gold
Posts: 20
Joined: 15 Dec 2008 18:29
Family Historian: V7

Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by martinpbudd »

I am just starting to dip my toe into LUA and write plugins. I have looked at the help in FH and become totally confused... My first project was to write a routine that run each of 33 queries sequentially saving the results in a pre-existing Named List. ie

Run "Awaiting 1841 Census" query, Save results to "Awaiting 1841 Census" named list
Run "Awaiting 1851 Census" query. Save results to "Awaiting 1851 Census" named list
.
.
.
Rinse and Repeat through list of queries.

Currently I am doing this manually and, as you can imagine, it takes some time. The lists show the gaps where either the events don't exist or don't have adequate sourcing and act as drivers for future research.

I can't find anything in the help files about running queries and saving to named lists. I have thought it might be that I have to code the query details into the plugin rather than just running an external query.

The icing on the cake would be a pick list of all queries which could be ticked to run the selected ones and save the results, which would make it useful to many people, I think.

Any help from the LUA gurus appreciated.
User avatar
Valkrider
Megastar
Posts: 1587
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by Valkrider »

I have a single query that runs this for all England census from 1841 to 1939. I am more than happy to share it if it is useful.
User avatar
Jane
Site Admin
Posts: 8535
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by Jane »

You can't output to Named lists currently from Lua.

You can however set Flags to track items needing work.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
avatar
jelv
Megastar
Posts: 683
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by jelv »

Have you looked at the plugin https://pluginstore.family-historian.co ... nsus-facts

Not only does it identify where census facts are missing but also gives clickable links to search for them on the common sites.
John Elvin
User avatar
tatewise
Megastar
Posts: 28708
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by tatewise »

See Wish List Ref 636 Named List programmable access that requests programmable access to Named Lists similar to Record Flags. That would apply to Expressions as well as Plugins. Please Vote for that Wish List item.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2596
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by Mark1834 »

To build on Jane’s comment for those interested in the plumbing -

Flags are custom fields within the Individual record, so can be both read and set by plugins, or read by queries. Custom lists are not (currently) FH records, and are stored in the GEDCOM header section, which is not generally accessible to plugins via the normal plugin API. A workaround is to read the GEDCOM file directly, but it’s a bit of a kludge.

On the more general point, plugins only read and write FH data. They cannot automate other processes such as running queries.
Mark Draper
User avatar
martinpbudd
Gold
Posts: 20
Joined: 15 Dec 2008 18:29
Family Historian: V7

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by martinpbudd »

Valkrider wrote: 13 Jun 2024 20:40 I have a single query that runs this for all England census from 1841 to 1939. I am more than happy to share it if it is useful.
I have queries that look specifically for individuals that fit the birth/death date range and do not have that year census flag set (which AS does for me when I record the census). This produces a list of potential suspects that could be missing a census entry for that yearwhich I save to a list. I have this for each census/register year.

I have also used the forum query which produces a grid showing whether censuses are present or not but i find this a bit cumbersome.

I suspected that the Named List would be sticking point as the queries could be coded relatively easily. I'll follow Mike's suggestion and vote for the Named Lists to be added to plugin access.

@jelv I have seen that plugin but I only use Ancestry and my queries search my whole database not just a subset so the query is not particularly useful to me.

@Jane I have a myriad of flags already, covering countries born/death, censuses, BMD records........ I have a flag for Census xxxx found (set by AS on recording) and Census xxxx Not Found (if I cant find or cant determine which record to choose). My query looks for people alive (or potentially alive) during the census year and then removes any with either flag set.

Thanks for all the help everyone....
User avatar
tatewise
Megastar
Posts: 28708
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Running Multiple Queries from a Plugin & Saving Results to Named Lists

Post by tatewise »

martinpbudd wrote: 16 Jun 2024 01:12 @jelv I have seen that plugin but I only use Ancestry and my queries search my whole database not just a subset so the query is not particularly useful to me.
The Lookup Missing Census Facts plugin does not necessarily search just a subset.
It has an option to search every Individual...
Set Choose the Individuals to investigate: Anyone via the Select Records dialogue and select everyone in a single click.

As well as Ancestry, it offers to search other databases, some of which are free, at least for some census years.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply