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
* Nested function sentence template
- Robert Jacobs
- Famous
- Posts: 111
- Joined: 21 Mar 2015 18:03
- Family Historian: V7
- Location: Ellensburg, Washington, U.S.A.
- Contact:
-
redvanman
- Diamond
- Posts: 80
- Joined: 10 Jun 2010 10:51
- Family Historian: V7
- Location: Dalbeattie, Kirkcudbrightshire
Re: Nested function sentence template
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
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
- 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
Robert