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.
Field Syntax can be defined as a “code” within the Ivinex system that is used to get field data from a specific field in a data module by it’s unique name or unique ID.
Default Record Fields: There are a few fields that are automatically generated for every record. As long as there is at least one record in a module, these fields are always available when using field syntax.
- Created By: [Field: created_by] (The username of the person who created the record.)
- Created Date: [Field: created_date] (The date the record was created.)
- Modified By: [Field: modified_by] (The username of the person who last modified the record.)
- Modified Date: [Field: modified_date] (The date the record was modified.)
- Record ID: [Field: collection_id] (The ID of the record.)
The other fields we can access using Field Syntax depend on the data fields that were built into the module we are attempting to pull data from.
Field Name Modifications: Automatic modifications to field names within the Ivinex system (Fig. 1).
- All lowercase.
- Underscores replace spaces.
- All non-letter/number punctuation removed.
- If there are two fields with the same name, the second field will end with a number, starting from 0.
Now that we know how Ivinex modifies field names, we can use the field names or the field ID’s to get data using field syntax.
Advanced Field Syntax
When using Field Syntax to get data from the “Linked Record” field type, it’s important to note that the field itself is referencing another field in a different module (Fig. 2).
- : syntax: [Field: linked_field_name:actual_data_field] (most common method).
This method is most commonly used to get field data from a linked record. It is possible to use the chaining syntax multiple times in a row to get data from a field that may be 1, 2, or 3 linked records away. There is no limit on how many times you can use the : syntax in a row.
When using Field Syntax to get data from the “Radio” and “Select” field types, it is important to note that these field types support multiple options, and each option has a respective ID and “text” value. (Fig. 3).
The vertical bar (or “pipe”) syntax:
- | syntax:Used to specify the type of data to be returned.
- |0 syntax: [Field: example_field|0] = Will force the ID to be returned.
- |1 syntax: [Field: example_field|1] = Will force the text value to be returned.
Fields where the | syntax makes a difference:
Table Syntax enables us to output a table of data (multiple records from a data module) in an email or static field.
The syntax to display a table is the following:[Table: <Module>|<Fields>|<Style>|<Order By>|<MaxNumRows>]
- Module: The module (or tab) that you want to show in the table.
- Fields: Comma separated list of field names (or IDs) to show. If you leave this blank, the default will be displayed.
- Style: HTML or TEXT.
- Order By: How you want this sorted.
- MaxNumRows: The Max number of rows to display.
This means, display a table of Activities, use the default fields, display in HTML format, order by the collection_id in descending order, and display all of them. (The collection ID is the internal ID of each record…it is incremented by one each time another is created, so it’s really the reverse order of the created date).
If you wanted to only display the very last activity, you would type:[Table: Activity||HTML|collection_id^desc|1]
User Syntax is similar to Field Syntax in the way it allows us to get data. The User fields however are not related to a module (that we can create), instead they are related to the individual user fields found in the User Manager.
Available User Information Fields:
Using these will return the information stored in the User Manager for the current logged in user.
- [User: first_name]
- [User: last_name]
- [User: alias]
- [User: title]
- [User: email]
- [User: address]
- [User: phone]
- [User: extension]
Following along with our previous Field Syntax example, we will now incorporate User Syntax:
Here is a coupon code for 10% off your next order.
[User: first_name] [User: last_name]
Phone: [User: phone] Ext: [User: extension]
Here is a coupon code for 10% off your next order.
Phone: 123-456-7890 Ext: 777
The Ivinex platform currently supports the following mathematical symbols:
- + (addition)
- - (subtraction)
- * (multiplication)
- / (division)
- ^ (exponentiation) or (power)
- % (modulo)
Here are a few examples of how to construct simple equations in Ivinex:
More advanced equations are supported in Ivinex.
Where to use Syntax Codes
Now that we have learned all about syntax codes, the next step is learning where we can use them.
Using syntax codes within email templates is very helpful when you want to customize or insert user / client specific data (Fig. 4).
When sending out an email, the Ivinex system also allows you to request notifications when the email has been opened. The notifications can be generic, or we can select a custom notification (email template) that is sent back to us.
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 the “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 (collection_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 (Fig. 6.1). 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.
Field data can be pulled into a filter using Field Syntax (Fig. 7).
Equation (Field Option)
- 15 September, 2014 @ 9:46 [Current Revision] by Ivinex Customer Support
- 15 September, 2014 @ 9:46 by Ivinex Customer Support
- 15 September, 2014 @ 9:46 [Autosave] by Ivinex Customer Support
- 26 June, 2013 @ 17:09 by Ivinex Customer Support
- 6 June, 2013 @ 20:42 by Ivinex Customer Support
- 15 May, 2013 @ 15:02 by Ivinex Customer Support