* Help with an expression

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
User avatar
Ossey55
Diamond
Posts: 69
Joined: 28 Apr 2022 22:30
Family Historian: V7
Location: Bolton, Mississippi, USA

Help with an expression

Post by Ossey55 »

I am trying to use an expression to show when someone has a GPS location for a tombstone in the Burial note field.
expression: =ContainsText(%INDI.BURI.NOTE%,"GPS",STD)
It does not give me an error when I exit and apply but it does not show the icon I set for it.
I am very new to Family Historian, about 3 months now coming from Family Tree Maker for over 30 years. Any help would be appreciated.
Jim
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with an expression

Post by tatewise »

Welcome to the FHUG Jim.

Reading between the lines, I guess you are using the Diagram > Options > Boxes tab to set a Condition Expression for an Icon feature.

When you use the << Insert Data Ref button the Individual + Events + Burial + Note option will provide the Expression for %INDI.BURI[1].NOTE2[1]% that refers to the local Note on the Burial event.

Whereas, Individual + Events + Burial + Note Record> will provide %INDI.BURI[1].NOTE[1]>% that refers to a linked shared Note Record.

The subtle difference is NOTE2 for a local Note versus NOTE for a linked Note Record. That difference trips up many new users.

BTW: The [1] indexes specify the 1st instance of the associated item but if omitted the data reference refers to the 1st instances by default. There is only likely to be one Burial (BURI) event and one local Note (NOTE2) so the default is OK. However, other facts such as Occupation, Census, Residence and other data structures typically have more than one instance where the index is crucially important.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ossey55
Diamond
Posts: 69
Joined: 28 Apr 2022 22:30
Family Historian: V7
Location: Bolton, Mississippi, USA

Re: Help with an expression

Post by Ossey55 »

Thank you Mike. I will try that.
One other question for you,
When would you use the Insert Data Ref button instead of adding a Condition Expression?
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with an expression

Post by tatewise »

The << Insert Data Ref... button is a feature of the << Add Condition > Expression dialogue. They are not mutually exclusive.
For example, the button lets you insert a Data Reference into a Function parameter in the Expression.

You will discover throughout FH that Expressions are used in many dialogues to specify customisation details.
An Expression is composed of:
  • Data References that refer to database items such as %INDI.BURI.NOTE2%
  • Functions that manipulate the data items such as =ContainsText( ... )
  • Operators that combine or compare the data such as + - > <
Most Expression dialogues have a Data Ref Assistant (DRA) button to help compose Data References.
There is nothing similar for Functions or Operators.

See FHUG Knowledge Base Understanding Expressions for much more detail and pointers to FH Help pages, etc.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ossey55
Diamond
Posts: 69
Joined: 28 Apr 2022 22:30
Family Historian: V7
Location: Bolton, Mississippi, USA

Re: Help with an expression

Post by Ossey55 »

Mike,
That worked to get an icon for anyone that had a note, but I want it to search for GPS in the note field. That will tell me that I have a GPS location for the tombstone for that person, not just a stone and a Find-A-Grave number.
I am not sure if the program can do that or not.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with an expression

Post by tatewise »

Jim, it really helps us if you can provide the expression that does not work for you, otherwise we are working in the dark.
You know what you used but we don't!

Your original posting says you used the Expression =ContainsText( %INDI.BURI.NOTE%, "GPS", STD )
That is perfect except that the data reference in 1st parameter should be %INDI.BURI.NOTE2% as I explained.

So the Expression =ContainsText( %INDI.BURI.NOTE2%, "GPS", STD ) should work perfectly and works for me.
What are you using?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ossey55
Diamond
Posts: 69
Joined: 28 Apr 2022 22:30
Family Historian: V7
Location: Bolton, Mississippi, USA

Re: Help with an expression

Post by Ossey55 »

Thanks Mike,
I had a typo, I left out the comma after "GPS"
Thanks again for your help
Jim
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with an expression

Post by tatewise »

I'd be interested to know how you managed to omit that comma.
If I do that and then click OK FH automatically inserts a comma.
I've tried all sorts of edits and either FH corrects the typo or says 'Expression not valid'.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Ossey55
Diamond
Posts: 69
Joined: 28 Apr 2022 22:30
Family Historian: V7
Location: Bolton, Mississippi, USA

Re: Help with an expression

Post by Ossey55 »

It was saying expression not valid. I thought I was using the wrong note field at first (locial, or linked note), so I was changing it and forgot to put the comma in.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with an expression

Post by tatewise »

OK, what confused me was you said that it "worked to get an icon for anyone that had a note".
So at some stage, you must have entered a valid expression and I thought that was the one with a missing comma.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply