Tag IF Statements

Sometimes you might need to insert content inside your document output depending on a source value. To achieve this you can use the IF formula.

IF formula

Returns one value if a logical expression is `TRUE` and another if it is `FALSE`.

Sample Usage

{{=IF(tag name = foo,"Tag is foo", "Tag is not foo")}}

{{=IF(tag name,"Tag was true","Tag was false")}}

{{=IF(TRUE,4,5)}}

Syntax

{{=IF(logical_expression, value_if_true, value_if_false)}}

  • logical_expression - An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE.

  • value_if_true - The value the function returns if logical_expression is TRUE.

  • value_if_false - [ OPTIONAL - blank by default ] - The value the function returns if logical_expression is FALSE.

The tags included in the brackets don't need to be accompanied by "{{" and "}}"

Contains

You can use ~ in place of the = and the condition will be true as long as the variable text is contained within the comparison text (or vice versa). e.g.

{{=IF(tag name ~ foo,"Tag contains foo", "Tag does not contain foo")}}

This formula would be true if the tag contained "foo"

Conditions across group data

By using the IFANY formula in a data grouping workflow, a condition can be evaluated against all the values of a varying field. e.g. {{=IFANY(Data Group Value = "Wally", "Found him!", "Nada!")}}

Feedback and feature suggestions

We created Portant in 2021, and the feedback we have received since then has been very helpful and greatly appreciated. If you have any feedback, please feel free to send us an email at contact@portant.co or use our contact form here: https://www.portant.co/support

Thanks,

Blake and James

Last updated