Page 1 of 1

Nested function sentence template

Posted: 14 Feb 2021 14:15
by Robert Jacobs
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

Re: Nested function sentence template

Posted: 14 Feb 2021 16:10
by redvanman
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

Re: Nested function sentence template

Posted: 14 Feb 2021 16:19
by Robert Jacobs
:) Super! That works perfectly Alyn. Thanks so much.


Robert