Skip to main content
Conga Support

Dissection of a Logic Statement

While Conga Collaborate delivers user-friendly "point & click" tools to help configure logic statements, advanced users can also configure logic statements from scratch, directly within a page’s HTML source code. This article examines the makeup of a logic statement and methods at your command.

Let’s start by examining a sample logic statement governing a block of content within a page, as viewed in the HTML source code.

<div data-show-if="proposal_client = 'ABC Company'">

All HTML tags are contained within a set of less than/greater than characters. All content within a valid HTML tag is not visible on the user-facing document.

<div data-show-if="proposal_client = 'ABC Company'">

 

The statement itself begins with div, the HTML element open tag to which logic is applied. A div tag is nothing more than a container unit that encapsulates other page elements and divides the HTML document into sections. When you create a conditional content block using the Conditional Content option on the editing toolbar, the dashed blue box surrounding your content represents a div tag in the source code.

Div tags, however, are not the only HTML elements to which a logic statement can be applied. Other useful examples include:
  • Paragraph <p></p>
  • Table <table> </table>
  • Table Row <tr></tr>
  • Table Data <td></td>
  • Ordered List <ol></ol>
  • Unordered List <ul>
  • List Item <li>
  • Span <span>

Spans are especially useful to dynamically show or hide specific content within a single paragraph tag. Where div and paragraph elements create line breaks throughout a body of content, spans do not, allowing for a continuous string of text. See an example of this below:

<p>Direct any inquires to the <span data-show-if="Opportunity_Region = 'North'">North</span><span data-show-if="Opportunity_Region = 'South'">South</span> region manager.</p>

This delivers a seamless paragraph in the previewed/published document showing only the appropriate text value.

Next, we enter the show or hide command.

<div data-show-if="proposal_client = 'ABC Company'">

This part of the logic statement, if true, determines whether the related content will be shown or hidden in the published document. There are two possible options here:

  • data-show-if=
  • data-hide-if=

Next, comes the primary portion of the statement to be evaluated. This is always surrounded by a set of double quotes. This differs from the use of curly or square brackets on a page’s content body. Whether one or multiple variables.

<div data-show-if="proposal_client = 'ABC Company'">


Within the double quotes, the statement begins with the variable field to be evaluated.

<div data-show-if="proposal_client = 'ABC Company'">

 

This can be a document variable, custom variable or CRM variable. The variable should be referenced by API name, as seen on the Variables tab. Note that variables in logic statements are case sensitive. If a variable’s API name contains uppercase letters but are entered as lowercase letters in a logic statement, the statement will fail and content will default to show.

Next is the operator.

<div data-show-if="proposal_client = 'ABC Company'">

The operator evaluates the variable field for a given value. Always ensure that a space exists on each side of the operator. If no space exists between the operator and the variable or value, the logic statement will fail and content will default to show. There are multiple operators available to apply in a logic statement. These include:

  • Equals                                  =
  • Does not equal                     !=
  • Is greater than                      >
  • Is greater than or equal to    >=
  • Is less than                           <
  • Is less than or equal to         <=
  • Contains                               LIKE
  • Does not contain                  NOT_LIKE
  • In                                          IN    
  • Not in                                   NOT IN
  • Is blank                                IS BLANK
  • Is not blank                          IS PRESENT

The final piece of a logic statement is the value associated to the variable.

<div data-show-if="proposal_client = 'ABC Company'">

First, note that each individual value referenced in a logic statement is surrounded by single quotes. Also, note that values within a logic statement are case sensitive. Given our example, if the true value of the proposal_client variable is ‘ABC Company’ but instead we entered ‘abc company’, the logic statement would return false and the related content would hide.

</div>

Logic statements are applied in an HTML element’s opening tag. Every opening tag has a corresponding closing tag that signals the completion of the element. Conga Collaborate will show or hide the entire element based on the logic present.

<div data-show-if="proposal_client = 'ABC Company'">This content is visible in my document if the logic statement is true.</div>

In the example above, the close acts as a stopping point for the logic statement. Any content beyond this tag will not be governed by the logic statement.

 

Logic statements with multiple variables and values

It is possible to string multiple logic statements together to create a complex logic statement. To do this, you can insert multiple ANDs or ORs between each collection of a variable, operator and value, but cannot use ANDs and ORs together in the same complex statement. For example:

<div data-show-if="proposal_client = 'ABC Company' OR proposal_client = 'XYZ Company'">
<div data-show-if="proposal_client = 'ABC Company' OR Opportunity_Industry = 'Tech'">
<div data-show-if="proposal_client = 'ABC Company' AND proposal_owner = 'John'">

Again, remember that it is not possible to insert combinations of AND and OR. Logic statements must be uniform with ANDs or ORs. Multiple ANDs or ORs can be used. As part of a conditional content block, ANDs or ORs must be represented by capital letters. This differs from the page logic level where lowercase letters are used.

Page and section level logic statements are not manually configured in a page’s HTML source code. Instead, statements are configured in the Page or Section properties menu, accessible from the Table of Contents column. Much like the Content logic statement builder tool, multiple conditions can only be configured by selecting the Show Advanced option. Here, you’ll use the same methods noted above to include additional variables and values to be analyzed. Again, be sure to use lowercase letters for or or and at the page logic level.

  • Was this article helpful?