* Locating a record via _UID

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
avatar
docdunning
Gold
Posts: 16
Joined: 08 Feb 2007 00:19
Family Historian: V7

Locating a record via _UID

Post by docdunning » 21 Mar 2022 13:02

Hi,

I'm using FMP for the online version of my tree, and I'm getting into using plugins as a way to apply updates to FH, using exported data from FMP. I'm very aware of the risks of doing this, but I'm interested to give it a try.

FMP applies a unique ID (in fairly standard guid format) to each exported record, and I do have those now on my FH records. They are in the _UID field.

For subsequent updates, I'd like to be able to locate a record via its _UID value. From what I can see, there is no built-in function to do this. My initial thought is that I have to build a lookup table which has a key of the _UID and a value of the FH record ID, and use that to convert one to the other ... at which point locating the record is straightforward.

Does anyone have/use an alternative approach to this?

Martin

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Locating a record via _UID

Post by Jane » 21 Mar 2022 14:08

That is the way I would do it. Scan once through all records and build a table indexed on the uid with the value being the record pointer (don't forget to clone it in). As you only need to grab one field it should be very quick to build the look up.

I would probably add some validation for duplicate and missing uids, while building the lookup.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
Mark1834
Megastar
Posts: 2147
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Locating a record via _UID

Post by Mark1834 » 21 Mar 2022 14:19

One possible ‘gotcha’ is that FTM and FH probably format the UniqueID differently, as there is more than one “standard” format. It may not matter at the moment if you are just using values ex FTM, but it could trip you up in the future.
Mark Draper

avatar
docdunning
Gold
Posts: 16
Joined: 08 Feb 2007 00:19
Family Historian: V7

Re: Locating a record via _UID

Post by docdunning » 21 Mar 2022 17:05

Thanks, both. Individuals are probably not too awkward, but I know that Families will be a bit of a challenge. Anyway, I'll give it a go.

User avatar
Mark1834
Megastar
Posts: 2147
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Locating a record via _UID

Post by Mark1834 » 21 Mar 2022 19:56

Does that mean that FTM assigns Family UniqueID values as well? Most packages now support Individual UniqueID, but I’ve not come across Family ones before.

The approach I use in the Ancestry sync plugin to uniquely identify the same family in both RM and FH is to create an identifier with multiple elements - the UniqueID of each spouse, plus the family number of each spouse (e.g. the first family of the Husband/Father, and the second family of the Wife/Mother).
Mark Draper

avatar
docdunning
Gold
Posts: 16
Joined: 08 Feb 2007 00:19
Family Historian: V7

Re: Locating a record via _UID

Post by docdunning » 22 Mar 2022 12:49

Hi Mark,

Yes, that's probably something like what I'll do. My workflow (so far as I've thought it through) will be to download the ged file from FMP, and import that to a new FH project. Once in there, I'll run a plugin to export the key details to a text file or two. Then I can open my main project and run a second plugin to read the text file(s) and apply changes as appropriate.

At this stage I'm not trying to do anything more than grab the key details for individuals and families. I can see that it will quickly get complicated otherwise.

Martin

Post Reply