* Reference a source meta field in a fact definition
Reference a source meta field in a fact definition
What is the easiest way to refence a meta field in a fact definition?
- 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
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.
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
Re: Reference a source meta field in a fact definition
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?
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?
- 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
You have not studied my examples closely enough!
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
Re: Reference a source meta field in a fact definition
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?
{%FACT.SOUR[1]>.~EN-TYPE%} is obviously wrong. But, how about {%FACT.SOUR[1].~TX-NUMMER%}? That should provide NUMMER shouldn't it?
- 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
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.
See my two formats and the note about > versus dot.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Reference a source meta field in a fact definition
It's a source field and that's what I did wrong, {%FACT.SOUR[1]>~TX-NUMMER%} work like a charm.
Thanks!
Thanks!