Overview

In this article, we will focus on the syntax and logic patterns used to execute advanced operations like repeating data in a table or a list and conditional IF/THEN logic. 

The Hashtag 

Before we get into specific logical operations, it is important to understand the basic element of how Athennian's logic engine works. We have simplified it to reduce the number of operator tags you need to remember. 

To start any logic operation, you simply need to begin the statement with a hashtag "#" after the first bracket. The hashtag is used to start loops, conditional logic and other more advanced logic operations. 

Now that we understand the hashtag, we can start learning about specific operators. 

Loops

Basic Loops

Loops are used to repeat data in a table or list to support listing out any variable type that frequently comes with multiple values (director names, shareholder stock amounts, etc.).

The basic syntax of a loop looks like this: 

{#officers} {firstName} {/} 

This statement will loop every officer's first name in a company unless you have selected specific officers in your entity record. In that case it would only print the specific officers' first names. In order to filter results by status (i.e., only incoming directors), see the Filters, Counting and Limits article. 

For example, if there were three officers in the company (Brenda, Blanca and, Ryo), then the above statement would display the following in the document:

Brenda Blanca Ryo 

If we wanted to include their offices next to their names, we could add in the variable {office} like this:

{#officers} {firstName} - {office} {/}

To produce an output like this: 

Brenda - Chief Executive Officer Blanca - VP Finance Ryo - Secretary


To list the names in a table or list, just organize the statement into a list or table as follows:

Note: To create effective loops, the close tag "{/}" must be in the last table cell that you want data to appear. 

Loops Inside of Loops

If you are writing a loop for a table that will include data from multiple sources such as a table that lists all directors and officers, then you simply need to select the data source for the loop and then write the data source for each variable that is not from the main data source. This is called a loop inside of a loop. 

For example, to list all directors and officers in a company, we would write the following statement: 

{#directors} {lastName}, {firstName} {#officers} {lastName}, {firstName} {/}{/} 

It's important to note the double close brackets to close out the two hashtags we used for the double loop. 

In a table, we would want to place the close tags on the last column cell where we want data to appear as follows: 

Conditional Logic

Overview 

Athennian's conditional logic allows you to create IF & IF NOT statements to automate content to support a variety of scenarios. 

To open a conditional logic statement, you must first enter the opening syntax {#} for the variables you wish to perform logic operations against.

{#variable}

To close a conditional logic statement, you must enter the closing syntax

{/}

IF / THEN Operations

Let's say we want to perform an IF statement on the jurisdiction, we can select {entity_jurisdiction} as the variable that we want to use for the conditional logic operations: 

{#entity_jurisdiction} {/}

Now that we have the selected the jurisdiction variable to automate from, we can start defining IF / THEN statements with the syntax {variable=='value'} like this :

{#entity_jurisdiction=='Alberta'} pursuant to section 117 of the Business Corporations Act (Alberta) {/}

With the above statement, if the jurisdiction value for this entity is Alberta, then Athennian will print the text up until the close tag {/}. 

It is possible to stack IF / THEN statements to by simply repeating the above statement through a paragraph of content area like this:

pursuant {#entity_jurisdiction=='Alberta'} to section 117 of the Business Corporations Act (Alberta) {/} {#entity_jurisdiction=='British Columbia'} “section 117 of the British Columbia Business Corporations Act” {/} {#entity_jurisdiction=='Ontario'} section 129 of the Business Corporations Act (Ontario){/} 

IF NOT Operations 

If you want to print content to appear if certain values ARE NOT TRUE, then you can sue the IF NOT statement != like this:

{#entity_jurisdiction!="Ontario"} This company is not registered in Ontario. {/}

If you want to print this statement ONLY IF more than one values are not met for the variable then you can list out multiple values like this: 

{#entity_jurisdiction!="Ontario"; "British Columbia"} This company is not registered in Ontario or British Columbia.{/}

Expressed in a full statement with IF/THEN statements, it looks like this: 

The undersigned, being the sole director of the Corporation, hereby consents to and adopts in writing the following resolutions pursuant to {#entity_jurisdiction=="Alberta"} section 117 of the Business Corporations Act (Alberta) {/} {#entity_jurisdiction=="British Columbia"} “section 117 of the British Columbia Business Corporations Act” {/}{#entity_jurisdiction=="Ontario"} section 129 of the Business Corporations Act (Ontario)” {/} {#entity_jurisdiction!="Ontario"||"British Columbia"} This company is not registered in Ontario or British Columbia.{/} (the “Act”). 


Did this answer your question?