* Nested function sentence template

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
Robert Jacobs
Famous
Posts: 111
Joined: 21 Mar 2015 18:03
Family Historian: V7
Location: Ellensburg, Washington, U.S.A.
Contact:

Nested function sentence template

Post by Robert Jacobs » 14 Feb 2021 14:15

I am trying to devise a template function which will return "the Bronx" whenever the word "Bronx" appears within a fact place. If the word doesn't appear, the template should return the Bronxless place. This is as close as I've been able to come:

{=TextIf (%FACT.PLAC% = (ContainsText(%FACT.PLAC%, "Bronx", STD)), "the Bronx", %FACT.PLAC%)}

Unfortunately it always returns FACT.PLAC (that is, the data). What am I doing wrong? As I understood the help files, the TextIf function returns the second variable if the first Boolean parameter returns "true" and the third if the Boolean is false.

If I can get this going it will save four or five hundred individual fact edits. Any suggestions warmly welcomed.

Robert

avatar
redvanman
Diamond
Posts: 80
Joined: 10 Jun 2010 10:51
Family Historian: V7
Location: Dalbeattie, Kirkcudbrightshire

Re: Nested function sentence template

Post by redvanman » 14 Feb 2021 16:10

Robert,
Try this:
{=TextIf (ContainsText(%FACT.PLAC%, "Bronx", STD), "the Bronx", %FACT.PLAC%)}

In your example, you were comparing %FACT.PLAC% with the result of =ContainsText() which is a boolean.

Alyn

User avatar
Robert Jacobs
Famous
Posts: 111
Joined: 21 Mar 2015 18:03
Family Historian: V7
Location: Ellensburg, Washington, U.S.A.
Contact:

Re: Nested function sentence template

Post by Robert Jacobs » 14 Feb 2021 16:19

:) Super! That works perfectly Alyn. Thanks so much.


Robert

Post Reply