Custom Fact Fields
Posted: 05 Jan 2023 15:44
In Emigration Fact - Copying and Using Both Copies (21346) Helen suggested creating a KB topic on custom fields for facts.
I am open to suggestions for the title but intend to add the article to the Entering and Editing Data section for Facts.
Parts of the article are derived from the Narrative Report Fact Sentence Templates section Custom Fact Fields which could later be removed.
All comments are welcome on the draft article below before adding it to the KB.
Entering Standard and Custom Fields for Facts
Skill Level: Advanced and Intermediate FH versions: V4, V5, V6, and V7 In Topics: Facts
When using most Facts, the standard Fields of Age, Date, Place, Address & Note are usually sufficient but sometimes extra fields are desirable. Those standard fields are described in Entering Ages, Entering Dates, Entering Sort Dates and Working with Places and Addresses.
However, when using standard Facts or creating custom Facts, there may be a desire to add custom fields to hold particular data.
Custom fields cannot be added to Facts, and even if they could, when exported in a GEDCOM file they would not be recognised by other genealogy products. This article explains some alternative techniques.
Basic Techniques
When designing a Custom Fact and just one extra field is needed, then instead of an Event try using an Attribute, which offers a value field after its name in the Facts tab, and is referenced by the {value} code in its Sentence Template (see standard Attributes such as Occupation and Property). There are no significant known issues when exporting to other products by reclassifying Events as Attributes. See Narrative Report Fact Sentence Templates for further details.
In addition to the Age, Date, Place, Address and Note fields, there are other standard fields available via the All tab of the Property Box including:
Cause (CAUS), Descriptor (TYPE), Email (EMAIL), Fax (FAX), Phone (PHON), Web Site (WWW), Responsible Agency (AGNC) & Religious Affiliation (RELI).
They can be used to hold appropriate information and referenced using {cause} or {%FACT.CAUS%}, {%FACT.TYPE%}, etc.
The Cause field is particularly useful because it automatically appears in Reports as illustrated later.
The Emigration and Immigration events have additional To and From (_PLAC) fields and users often wonder if those fields can be used in other facts. They cannot, but labelled Note meta-fields can be used instead.
Labelled Note Meta-fields
A popular method of adding custom fields uses labelled meta-fields in the Note box, and is illustrated here using a Baptism Event:
The following Function Codes in the Narrative Report Fact Sentence Templates would compose the Sentence text:
{individual} was baptised {date} {place} {age}
< by the {=GetLabelledText(%FACT.NOTE2%,"Minister: ")}>
< for a fee of {=GetLabelledText(%FACT.NOTE2%,"Charge: ")}>
Each labelled meta-field can be included or excluded in any combination desired.
This not only allows the details to be exported satisfactorily in GEDCOM, but also allows other Note text not required in the Sentence, unlike the {note} code that would include it all.
It is advisable to enclose the meta-fields in 'Private Note' privacy [[ brackets ]] so the fields or the brackets can be excluded from or included in Reports by adjusting the Options. Those [[ brackets ]] also exclude the fields from Note text produced by the {note} code.
In the Tools > Fact Types dialogue, Edit... definition, there is a handy feature via the Advanced... button that offers an Auto-Create Note box that can hold the meta-field Note labels, so they automatically get created whenever that Fact is added. To start each label on a new line use Ctrl+Enter to insert a line break.
Source Note Field
Alternatively, the Source Note field %FACT.SOUR2% can be used in much the same way but rather less obtrusively. It is a local Note that appears in the yellow Sources For pane, but is nothing to do with Source records. The way to add a Source Note is via the All tab in an Individual’s Property Box. Right-click the Fact and choose Add Source Note in FH7 or Add Source and then Add Source Note to this Record in earlier FH versions. Add the text to the Source Note and it will appear in the Sources For pane. To edit the text use the All tab again and expand the Fact to reveal the Source Note box.
When exported to other products there is a small risk that Source Notes may get converted to Source Citation Records.
Show Fact Fields in the Property Box
As explained above, a labelled meta-field is visible in the Note box and in the Sentence box when the Fact is selected.
Any field can be included in the Facts list at the top of the Facts tab so it is visible even when the Fact is not selected.
The custom fact Flew from illustrates this feature by adding a labelled Note meta-field To: Glasgow, Scotland second Place (see Emigration & Immigration events) and on the All tab by adding a Cause: by hot-air balloon field.
Use Tools > Fact Types, select the Fact, click the Edit... button, then the Advanced... button and enter the required templates.
Summary Template: Flew from {_place}< to {=GetLabelledText(%FACT.NOTE2%,"To: ")}> {cause}
Override Template: Flew {date} from {_place}< to {=GetLabelledText(%FACT.NOTE2%,"To: ")}> {cause}
Examples of the Fact Types dialogue, and the Property Box Facts tab and All tab are illustrated below.
Most of the other codes and functions are supported similarly to Sentence Templates. So standard fields such as Cause & Descriptor mentioned above can be displayed using the codes {cause} or {%FACT.CAUS%}, {%FACT.TYPE%}, etc.
Show Fact Fields in Reports
The Sentence Template defines how fields appear in Narrative Reports and others that use Narrative style Sentences. The template can use the codes {note} and {%FACT.NOTE2%} to include Note text, and the Report Options include Event/Attr Notes by default, but that option is inhibited fact by fact if the template codes are used to prevent duplicated Note text.
Most other reports show Notes by default, but if the labelled Note is enclosed in privacy [[ brackets ]] it will be excluded unless the Inc. [[private]] Notes option is enabled.
The labelled Note does not have to be in privacy [[ brackets ]] but that may cause other problems when there is further Note text.
An alternative is to create a 2nd local Note via the All tab and adjust the template expressions to support both the 1st and 2nd local Notes.
Template expression: < to {=GetLabelledText(%FACT.NOTE2%,"To: ")}>< to {=GetLabelledText(%FACT.NOTE2[2]%,"To: ")}>
The only drawback is the 2nd local Note is not shown in the Facts tab Note box, although it is shown in the Notes tab, and can be shown elsewhere in the Property Box as explained above.
Summary Conclusions
If a Custom Fact needs just one extra field, then instead of an Event try using an Attribute, which offers the value field and {value} code.
Consider using the standard Cause field and {cause} code available with every Fact and shown in Reports.
If other fields are needed then a flexible option is to use labelled Note meta-fields available with every Fact and optionally shown in Reports.
Finally, there are the standard All tab fields Descriptor, Email, Fax, Phone, Web Site, Responsible Agency, Religious Affiliation and Source Note.
I am open to suggestions for the title but intend to add the article to the Entering and Editing Data section for Facts.
Parts of the article are derived from the Narrative Report Fact Sentence Templates section Custom Fact Fields which could later be removed.
All comments are welcome on the draft article below before adding it to the KB.
Entering Standard and Custom Fields for Facts
Skill Level: Advanced and Intermediate FH versions: V4, V5, V6, and V7 In Topics: Facts
When using most Facts, the standard Fields of Age, Date, Place, Address & Note are usually sufficient but sometimes extra fields are desirable. Those standard fields are described in Entering Ages, Entering Dates, Entering Sort Dates and Working with Places and Addresses.
However, when using standard Facts or creating custom Facts, there may be a desire to add custom fields to hold particular data.
Custom fields cannot be added to Facts, and even if they could, when exported in a GEDCOM file they would not be recognised by other genealogy products. This article explains some alternative techniques.
Basic Techniques
When designing a Custom Fact and just one extra field is needed, then instead of an Event try using an Attribute, which offers a value field after its name in the Facts tab, and is referenced by the {value} code in its Sentence Template (see standard Attributes such as Occupation and Property). There are no significant known issues when exporting to other products by reclassifying Events as Attributes. See Narrative Report Fact Sentence Templates for further details.
In addition to the Age, Date, Place, Address and Note fields, there are other standard fields available via the All tab of the Property Box including:
Cause (CAUS), Descriptor (TYPE), Email (EMAIL), Fax (FAX), Phone (PHON), Web Site (WWW), Responsible Agency (AGNC) & Religious Affiliation (RELI).
They can be used to hold appropriate information and referenced using {cause} or {%FACT.CAUS%}, {%FACT.TYPE%}, etc.
The Cause field is particularly useful because it automatically appears in Reports as illustrated later.
The Emigration and Immigration events have additional To and From (_PLAC) fields and users often wonder if those fields can be used in other facts. They cannot, but labelled Note meta-fields can be used instead.
Labelled Note Meta-fields
A popular method of adding custom fields uses labelled meta-fields in the Note box, and is illustrated here using a Baptism Event:
The following Function Codes in the Narrative Report Fact Sentence Templates would compose the Sentence text:
{individual} was baptised {date} {place} {age}
< by the {=GetLabelledText(%FACT.NOTE2%,"Minister: ")}>
< for a fee of {=GetLabelledText(%FACT.NOTE2%,"Charge: ")}>
Each labelled meta-field can be included or excluded in any combination desired.
This not only allows the details to be exported satisfactorily in GEDCOM, but also allows other Note text not required in the Sentence, unlike the {note} code that would include it all.
It is advisable to enclose the meta-fields in 'Private Note' privacy [[ brackets ]] so the fields or the brackets can be excluded from or included in Reports by adjusting the Options. Those [[ brackets ]] also exclude the fields from Note text produced by the {note} code.
In the Tools > Fact Types dialogue, Edit... definition, there is a handy feature via the Advanced... button that offers an Auto-Create Note box that can hold the meta-field Note labels, so they automatically get created whenever that Fact is added. To start each label on a new line use Ctrl+Enter to insert a line break.
Source Note Field
Alternatively, the Source Note field %FACT.SOUR2% can be used in much the same way but rather less obtrusively. It is a local Note that appears in the yellow Sources For pane, but is nothing to do with Source records. The way to add a Source Note is via the All tab in an Individual’s Property Box. Right-click the Fact and choose Add Source Note in FH7 or Add Source and then Add Source Note to this Record in earlier FH versions. Add the text to the Source Note and it will appear in the Sources For pane. To edit the text use the All tab again and expand the Fact to reveal the Source Note box.
When exported to other products there is a small risk that Source Notes may get converted to Source Citation Records.
Show Fact Fields in the Property Box
As explained above, a labelled meta-field is visible in the Note box and in the Sentence box when the Fact is selected.
Any field can be included in the Facts list at the top of the Facts tab so it is visible even when the Fact is not selected.
The custom fact Flew from illustrates this feature by adding a labelled Note meta-field To: Glasgow, Scotland second Place (see Emigration & Immigration events) and on the All tab by adding a Cause: by hot-air balloon field.
Use Tools > Fact Types, select the Fact, click the Edit... button, then the Advanced... button and enter the required templates.
Summary Template: Flew from {_place}< to {=GetLabelledText(%FACT.NOTE2%,"To: ")}> {cause}
Override Template: Flew {date} from {_place}< to {=GetLabelledText(%FACT.NOTE2%,"To: ")}> {cause}
Examples of the Fact Types dialogue, and the Property Box Facts tab and All tab are illustrated below.
Most of the other codes and functions are supported similarly to Sentence Templates. So standard fields such as Cause & Descriptor mentioned above can be displayed using the codes {cause} or {%FACT.CAUS%}, {%FACT.TYPE%}, etc.
Show Fact Fields in Reports
The Sentence Template defines how fields appear in Narrative Reports and others that use Narrative style Sentences. The template can use the codes {note} and {%FACT.NOTE2%} to include Note text, and the Report Options include Event/Attr Notes by default, but that option is inhibited fact by fact if the template codes are used to prevent duplicated Note text.
Most other reports show Notes by default, but if the labelled Note is enclosed in privacy [[ brackets ]] it will be excluded unless the Inc. [[private]] Notes option is enabled.
The labelled Note does not have to be in privacy [[ brackets ]] but that may cause other problems when there is further Note text.
An alternative is to create a 2nd local Note via the All tab and adjust the template expressions to support both the 1st and 2nd local Notes.
Template expression: < to {=GetLabelledText(%FACT.NOTE2%,"To: ")}>< to {=GetLabelledText(%FACT.NOTE2[2]%,"To: ")}>
The only drawback is the 2nd local Note is not shown in the Facts tab Note box, although it is shown in the Notes tab, and can be shown elsewhere in the Property Box as explained above.
Summary Conclusions
If a Custom Fact needs just one extra field, then instead of an Event try using an Attribute, which offers the value field and {value} code.
Consider using the standard Cause field and {cause} code available with every Fact and shown in Reports.
If other fields are needed then a flexible option is to use labelled Note meta-fields available with every Fact and optionally shown in Reports.
Finally, there are the standard All tab fields Descriptor, Email, Fax, Phone, Web Site, Responsible Agency, Religious Affiliation and Source Note.