Page 1 of 1

Locating a record via _UID

Posted: 21 Mar 2022 13:02
by docdunning
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

Re: Locating a record via _UID

Posted: 21 Mar 2022 14:08
by Jane
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.

Re: Locating a record via _UID

Posted: 21 Mar 2022 14:19
by Mark1834
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.

Re: Locating a record via _UID

Posted: 21 Mar 2022 17:05
by docdunning
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.

Re: Locating a record via _UID

Posted: 21 Mar 2022 19:56
by Mark1834
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).

Re: Locating a record via _UID

Posted: 22 Mar 2022 12:49
by docdunning
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