Using Flags and Icons and Expressions

Introduction

Individual Flags and Diagram Icons have long been available in Family Historian (fh), but have had significant enhancements in V3 and V4.

Two default Flags are included with the program, namely Living and Private. These can be used in privacy filters where information is not to be shared.

Flags were perceived as a useful method of marking an Individual record, where a Named List was inappropriate.

Some users feel they are an excellent way of keeping a visual track, through Icons on Diagrams, for information such as what census records have been associated with people, immigration facts, death during infancy, twins, or work in progress.

Since fh V4 however, Flags are no longer needed where Icons are directly related to simple Data References or Functions, as explained later.

Flags may be useful in Queries that assist the selection of Individuals in the Split Tree Helper and Export GEDCOM File commands.

Using Flags

To add or clear a Flag for any Individual, first select the Individual Record(s) to be changed, then use the Edit > Record Flags… option. Either tick or clear the box against each Flag to be added or cleared and click OK. If a suitable Flag does not exist, then create a new one using the New button.

Flags can also be added by right-clicking an Individual Name in the Records Window or Property Box All tab, and using the Set Flag option. They can be cleared by deleting the Flags field from those views.

The Tools > Work with Lists and Flags menubar option offers other Flag Changing Tasks, and allows each Flag Status to be changed. If the status is Always include this record flag in flag lists then it will still be listed even when cleared from all Individual Records.

Since fh V4, there is no need to set a Flag simply to add an Icon to a Diagram, because there are easier methods, as explained in Using Icons below. Flags should be used for more subtle purposes such as identifying Individuals whose family relationship is doubtful, or where further research is required, or anything else that cannot be easily derived from the GEDCOM data itself.

Flags can be presented in Individual Record Window Columns by using an Expression such as =HasFlag(,"Living"). See the Worked Examples below for further advice. View > Standard Queries > Has Flag lists who has a chosen Flag.

The Census Flag & Date Tools tutorial explains how Ancestral Sources supports Flags in conjunction with Census entries, although since fh V4, as explained below, this feature is somewhat redundant.

Using Icons (and other Features)

Icons are managed in Diagrams by opening the Diagram > Options > Boxes tab and using the <<Add/Edit/Delete>> Condition buttons. See Index for related topics.

To select a Flag as a Condition, click the <<Add Condition button, choose Record Flag, and select the Flag from the list. A tab for that Flag will be added to the Record Flag pane below the Conditions.

Since fh V4, a Condition can also be an Expression that involves Data References or Functions. So a Flag is no longer needed to define a Condition associated with basic GEDCOM data.

To choose the Icon, first select the Condition Record Flag or Expression, then click the Edit Features… button. In the Box Features window, tick the Icon option and <<Select the Icon file.

Note that other Features can also be chosen to depict the Condition.

Worked Examples

As an example, assume that an Icon is desired to depict every Retirement Event, and a Y presented in an Individual Record Window Column.

FH Versions 2 & 3

Prior to fh V4, a Custom Query must be written to select every Individual with a Retirement Event by using a Rows filter like Add unless %INDI.RETI% is null. Then the Set Flag on Result Set Records menu option would set the desired Flag for each Individual. Finally, the Flag must be added to the Condition Record Flag and the Icon selected as described above. To ensure the Flag and Icon are factual, the Set Flag on Result Set Records option must be repeated every time any Retirement Event is added or removed. See the Animated Tutorial below for a similar worked example.

Flags can be presented in Individual Record Window Columns as a Y by using an Expression such as =HasFlag(,"Retired"). See Customise or Print Records Window Columns for a similar worked example.

FH Version 4 or later

Since fh V4, simply add a Condition Expression of %INDI.RETI% and select the Icon as described above. With this technique the Icon is always factual, because its Condition is the Retirement Event itself.

An Individual Record Window Column Expression can be used to signal the same Condition with a Y by using the =Exists(%INDI.RETI%) Function. See Customise or Print Records Window Columns for a similar worked example.

More Example Query/Icon Condition Expressions

To obtain more precise Conditions use an Expression based on the examples below, assisted by the <<Insert Data Ref… button.
%INDI.RETI.DATE% will match the 1st Retirement Event if it has a Date defined.
%INDI.BAPM.SOUR>% will match the 1st Baptism Event if it has a Source Citation.
%INDI.CENS[year=1901]% will match a Census Event with a Date in 1901.
%FAM.MARR.PLAC% will match the 1st Marriage Event if it has a Place defined.

Much more complex Expressions are possible with the use of Functions and some examples are given below:
=Exists( %INDI.FAMS>MARR.PLAC% ) is an alternative to the preceding 1st Marriage Event example.
=Exists( %INDI.FAMS[2]>MARR.PLAC% ) is a similar alternative, but for a 2nd Marriage Event.
=IsTrue( %INDI.CENS[year=1871].SOUR>_TYPE% = "Census" ) matches a Census Event in 1871 with a Source Citation where its Type is Census.
=ContainsText( %INDI.BAPM.SOUR>TITL%, "Baptism", STD ) matches the 1st Baptism Event if it has a Source Citation whose Name contains the word Baptism.
=IsTrue( (Diff(DayNumber(%INDI.BIRT.DATE%),DayNumber(Field(NextSib(%INDI%,1),'INDI.BIRT.DATE'))) < 2 ) or (Diff(DayNumber(%INDI.BIRT.DATE%),DayNumber(Field(PrevSib(%INDI%,1),'INDI.BIRT.DATE'))) < 2 ) ) finds twins and other multiple births.

More Example Record Window Column Expressions

If an Icon uses a Condition Expression then there may not be a matching Flag. However, a similar Column Expression can be used to depict the same Condition by adding the =Exists() Function as illustrated below:
=Exists( %INDI.RETI.DATE% ) will match the 1st Retirement Event if it has a Date defined.
=Exists( %INDI.BAPM.SOUR>% ) will match the 1st Baptism Event if it has a Source Citation.
=Exists( %INDI.CENS[year=1901]% ) will match a Census Event with a Date in 1901.
=Exists( %INDI.FAMS>MARR.PLAC% ) will match the 1st Marriage Event if it has a Place defined.

More complex examples include:
=Exists( %INDI.FAMS[2]>MARR.PLAC% ) will match a 2nd Marriage Event if it has a Place defined.
=IsTrue( %INDI.CENS[year=1871].SOUR>_TYPE% = "Census" ) matches a Census Event in 1871 with a Source Citation where its Type is Census.
=ContainsText( %INDI.BAPM.SOUR>TITL%, "Baptism", STD ) matches the 1st Baptism Event if it has a Source Citation whose Name contains the word Baptism.
=IsTrue( Exists( %INDI.FAMS>MARR.SOUR% ) or Exists( %INDI.FAMS[2]>MARR.SOUR% ) or Exists( %INDI.FAMS[3]>MARR.SOUR% ) ) matches if the 1st, 2nd, or 3rd Marriage Event has a Source Citation.

In fact any such Column Expression would also work as the Boxes Condition Expression.

Animated Tutorial

This tutorial is for fh Version 3 on Windows XP, but despite slightly different layout and colours, some concepts are still valid for later versions as discussed above.

Using Flags

Using Flags and Icons

As of fh V4 you can use %INDI.CENS[year=1901]% directly in a Boxes > Condition > Expression rather than creating a Custom Query to set a Flag for the Boxes > Condition > Record Flag option.

To add an Icon, open the Box Features window, tick the Icon option and <<Select the Icon file. This file can be anywhere on the PC, but may not survive migrating to another PC.

If the Icon file is in the Family Historian Program Data Folder Icons sub-folder, then just its filename is saved and will migrate to another PC. So if you need custom Icons, add them to this Icons sub-folder.

In all other cases the Icon file path is saved in full, and often will NOT migrate to another PC, so the Icon file link will become broken and need repairing. If the Family Historian Program Data Folder is synchronised on two PC via cloud storage such as Dropbox then this is unworkable for the synchronised Diagram files. A possible solution is to use a folder that has the same file path on most PC, such as the Public Pictures folder, or the Family Historian Program Data Folder sub-folders, which are the same on Windows Vista/7/8/10.