Using Field Replacements

<< Click to Display Table of Contents >>

Navigation:  Trigger Actions >

Using Field Replacements

All actions that have parameters allow you to use %fieldname% replacements. This means you can specify a ThinkAutomation field name, variable, built-in field or constant in the parameter that will be replaced at execution time with the value of the field or variable. Field names must be enclosed with % symbols.

 

For example, outgoing emails can contain values extracted from the incoming message by simply inserting %fieldname% (where 'fieldname' is the name of your field) into the email text (or any other fields).

 

Another example: The 'Attachments' action lets you save attachments from the incoming message to folders on your system. If you had created a field called 'OrderNumber' you could save the attachment as '%OrderNumber%.pdf'.

 

Built-In Fields

In addition to extracted fields or variables that you create yourself, you can also use any of the following built-in fields:

 

%msg_body%

The original plain text message. (If the message is HTML and has no plain text, ThinkAutomation will create a plain text version and store it here).

%msg_html%

The HTML version of the original message (if it has one).

%msg_mimetext%

The complete mime text of the message (including attachments).

%msg_subject%

The original message subject.

%msg_to%

The 'To' email address(s). Just the email addresses separated by commas. Name portions are removed.

%msg_towithnames%

The To addresses including names (if available).

%msg_from%

The 'From' address.

%msg_fromname%

The 'From Name' if available.

%msg_fromip%

The IP address of the sender.

%msg_cc%

The 'CC' addresses. Just the email addresses separated by commas. Name portions are removed.

%msg_ccwithnames%

The 'CC' addresses including names (if available).

%msg_bcc%

The 'BCC' addresses. Just the email addresses separated by commas. Name portions are removed.

%msg_bccwithnames%

The 'BCC' addresses including names (if available).

%msg_replyto%

The 'Reply To' address.

%msg_inreplyto%

The 'In Reply To' header.

%msg_references%

The 'References' header.

%msg_return-path%

The 'Return-Path header.

%msg_sender%

The 'Sender' header field.

%msg_date%

The date of the message.

%msg_datesent%

The date the message was originally sent.

%msg_size%

The total size of the message including attachments (in bytes).

%msg_headers%

The complete headers section of the email.

%msg_attachments%

A string containing each attachment file name (separated by CrLf).

%msg_attachmentcount%

The number of attachments.

%msg_attachmentinlinecount%

The number of inline attachments.

%msg_attachmentssavedto%

A string containing the file system location of each saved attachment (if Attachment saving action used).

%msg_attachmentlistwithsizes%

A string containing each attachment & size separated by commas eg: 'document1.pdf (2mb), document2.pdf (500kb)'

%msg_charset%

The character set used on the email.

%msg_messageid%

The Unique message identifier.

%msg_geoipcity%

The GEO-IP City data for the senders IP address.

%msg_geoipcountry%

The GEO-IP Country data for the senders IP address.

%msg_geoiporganization%

The GEO-IP Organization data for the senders IP address.

%msg_wordindex%

Unique keywords extracted from the message body (space separated excluding common words).

%msg_wordindexsorted%

Unique keywords sorted by word count (highest first).

%msg_wordindexwithcount%

Unique keywords with word count.

%msg_wordindexwithcountsorted%

Unique keywords with word count sorted (highest first).

%msg_digest%

The first 500 characters of the plaintext body with all whitespace removed.

%msg_viewurl%

A link to the ThinkAutomation web services viewmessage URL. See: The Message Link URL

%msg_validationurl%

A link to the validation web page for the message - used by the Wait For Validation action. See: Wait For Validation

%msg_extractedfieldsjson%

A string containing JSON formatted text for all extracted fields and their values.



%date%

The current date.

%time%

The current time.

%hour%

The current hour (0-23).

%minute%

The current minute (0-59).

%datetime%

The current date & time.

%sqldate%

The current date in yyyy-mm-dd format.

%sqldatetime%

The current date & time in yyyy-mm-dd hh:mm:ss format.

%dayofweek%

The current day of week string.

%weekdaynumber%

The current day of the week number (1=Sunday, 2=Monday etc).

%monthnumber%

The current month number.

%monthname%

The current month name.

%year%

The current year number.

%lasterrornumber%

This will contain a numeric error number returned from an Action that has failed for some reason.

%lasterrortext%

This will contain a description of the last error.

%freediskspace%

The current system drive free space in bytes.

%root%

The document root folder. Corresponds to ProgramData\Parker Software\ThinkAutomation\{organization name}\

%triggerlog%

The current trigger execution log for the message.

%accountname%

The name of the ThinkAutomation Account associated with the current message.

%triggername%

The name of the ThinkAutomation Trigger associated with the current message.

%organizationname%

The name of your Organization.

%organizationemail%

The default email address of your Organization.

%filename%

Used on Actions that use Attachments. When referenced will replace the current filename. The extension will be appended to the resulting string. Eg: %filename%%ordernumber% if used as a filename would result in 'invoice1234.pdf' assuming the current attachment filename was 'invoice.pdf' and %ordernumber% contained '1234'.

%func%

Used to execute an InLine function. See InLine Functions.

%timer%

The current time elapsed since midnight.

 

You can assign any of the above fields to fields you create in ThinkAutomation. You can also use them directly in any Action parameters.

 

Dropping Field Names Into Action Parameters

Each Action form includes the Fields Tree:

 

fielddragdrop

 

Drag and drop any field/variable or built-in field to any of the editable Action fields to use that field in the entry. At execution time the %field% will be replaced with its value. You can also directly type any %field% or %variable% into any entry. Click the Add Global Variables button to add a new variable whilst editing any action. You can also create variables by dragging the Set Variable action on to your Actions list.

 

See Also: Organization Constants

 

See Also: InLine Functions

 

 

ThinkAutomation © Parker Software 2016