General User

 

Syntax Codes

 

Syntax codes provide a more advanced method for retrieving, chaining, and performing calculations on data from different fields. From creating simple mail merge functionality to performing complex equations using many data fields, syntax codes make this possible.

Where to use Syntax Codes

Now that we have learned all about syntax codes, the next step is learning where we can use them.

Email Templates

Using syntax codes within email templates is very helpful when you want to customize or insert user / client specific data.

 

Workflow Actions

Email Workflow

Example: We want to automatically send an email to the account owner with the account status has changed. The email needs to contain the account name and the new status. In our workflow action we use Field Syntax to pull data into the email: Email To: [Field: account_owner: email]. Subject: [Field: account_name] status changed to [Field: status].

Warnings:
The Send Email workflow action MUST include a from email address or the action will fail.
- Make sure to setup a system email account before sending any workflow emails. If you do not, the email may not send and if it does, it will not be from your email account. This email will be flagged as spam.

Advanced Record Update

Example: Let's say we created an accounts module and a products module. The accounts module is related to the products module in a one to many relationship (one account with many products). We then decide to add linked record fields to the product module that are supposed to show data from the account module fields. We have “Automatically set if linked” check box selected for all the new linked record fields, but the new fields are not yet aware of the linked status (even though the product IS linked to the accounts module (Shows up in “Related Accounts”). We decide to build a timer workflow that will update all the new linked record fields with the RELATED account data.

In this special case, we must use the Record ID of the related account in the field syntax: [Field: Account: collection_id]. We first setup a filter to check for fields that are not yet linked. We then setup the workflow action to use the module name and the collection_id (record ID). When the timer workflow runs, it will find the related account BY its RECORD ID and set the linked fields.

 

Fig 6.2 - Using module name and collection_id field syntax.

Fig 6.2 – Using module name and collection_id field syntax.

Filters

Field data can be pulled into a filter using Field Syntax.

Fig. 7 - Using Field Syntax in a Filter

Fig. 7 – Using Field Syntax in a Filter

Display Conditions

Example: We want to show a static field that says “Email does not match!” when our field “Confirm Email” does not match our field “Email Address”. We create a display condition that uses the following rules:  Confirm Email NOT Equal to blank, and Confirm Email NOT Equal to [Field: email_address].

Note: When using display conditions, you cannot currently use field syntax that includes the ID of a field. You must use syntax that uses the name of the field.

- Example: [Field: email_address] works, [Field: 12953] does not work. This should be fixed in the near future.

Fig. 8 - Using Field Syntax in Display Conditions

Fig. 8 – Using Field Syntax in Display Conditions

Equation (Field Option)

Example: We want to create an equation that multiplies the “Price” field by the “Quantity” field and outputs the result into the “Total Cost” field. In the “Total Cost” Field Display Options window, we would add the following equation (using Field Syntax) into the Equation field option: [Field: price] * [Field: quantity].

Fig. 8 - Using Syntax Codes in Equation Field Options.

Fig. 8 – Using Syntax Codes in Equation Field Option.

Static Field

Example: We want to use a linked record field type to set the “Account Owner” for our accounts module. After selecting the “Account Owner”, we want to also display other information about the “Account Owner”. Using a static field we enter in the following Field Syntax into the “Text To Display” area: Name:[Field: account_owner: first_name] [Field: account_owner: last_name] Phone [Field: account_owner: phone] Cell: [Field: account_owner: cell_phone].

Fig. 9 - Field Syntax in Static Field

Fig. 9 – Field Syntax in Static Field “Text To Display” Area.