* Reference a source meta field in a fact definition

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
JoopvB
Superstar
Posts: 328
Joined: 02 May 2015 14:32
Family Historian: V7

Reference a source meta field in a fact definition

Post by JoopvB » 20 Apr 2023 21:14

What is the easiest way to refence a meta field in a fact definition?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Reference a source meta field in a fact definition

Post by tatewise » 20 Apr 2023 21:31

I guess you mean in a Sentence Template and are referring to Templated Source Citation metafields?
The complication is that the Fact can have multiple Source Citations, so you must cater for %FACT.SOUR[1]...% and %FACT.SOUR[2]...% and %FACT.SOUR[3]...% and so on for as many Citations as might exist, unless you can be sure that the metafield will always be in the 1st Citation.

It also depends on whether it is a Citaion-specific metafield or a Source record metafield.
The format for the metafield shortcut is given near the end of Understanding Data References.

So if it is a Citation-specific Text metafield called Type then the data reference is:
%FACT.SOUR[1].~TX-TYPE%

If it is a Source record Date metafield called When then the data reference is:
%FACT.SOUR[1]>~DT-WHEN%

Note the > link to the Source record instead of the dot for a Citation.

I have not double-checked those data refs but fairly sure they are correct.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
JoopvB
Superstar
Posts: 328
Joined: 02 May 2015 14:32
Family Historian: V7

Re: Reference a source meta field in a fact definition

Post by JoopvB » 21 Apr 2023 09:54

I have a single source with the meta fields NUMMER (text) and TYPE (enumerated). My goal is to reference both fields in a fact sentence definition.

Following your advice I tested {%FACT.SOUR[1].~TX-NUMMER%} and {%FACT.SOUR[1]>.~EN-TYPE%}. The first one shows nothing (although the "nummer" exists) and the second one shows {%FACT.SOUR[1]>.~EN-TYPE%}.

What am I doing wrong?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Reference a source meta field in a fact definition

Post by tatewise » 21 Apr 2023 10:14

JoopvB wrote:
21 Apr 2023 09:54
What am I doing wrong?
You have not studied my examples closely enough! :D

Explain to me your reasoning for using dot [1].~ in one case and > dot [1]>.~ in the other.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
JoopvB
Superstar
Posts: 328
Joined: 02 May 2015 14:32
Family Historian: V7

Re: Reference a source meta field in a fact definition

Post by JoopvB » 21 Apr 2023 19:17

Sorry Mike, no reasoning (or maybe old age :)).

{%FACT.SOUR[1]>.~EN-TYPE%} is obviously wrong. But, how about {%FACT.SOUR[1].~TX-NUMMER%}? That should provide NUMMER shouldn't it?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Reference a source meta field in a fact definition

Post by tatewise » 21 Apr 2023 19:27

Depends on where NUMMER is. Is it a Citation-specific metafield or a Source record metafield?
See my two formats and the note about > versus dot.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
JoopvB
Superstar
Posts: 328
Joined: 02 May 2015 14:32
Family Historian: V7

Re: Reference a source meta field in a fact definition

Post by JoopvB » 21 Apr 2023 19:30

It's a source field and that's what I did wrong, {%FACT.SOUR[1]>~TX-NUMMER%} work like a charm.

Thanks!

Post Reply