Skip to content

General Information

Message Store Maintenance

The ThinkAutomation Server will automatically remove old processed messages from the Message Store database. The date at which a processed message is removed is defined by the Keep Messages For Days setting on the Solution properties (which defaults to 1095 days). This will affect messages processed by all Automations within the Solution.

Use the Edit Solution Properties button on the Ribbon to change this setting.

Set the Keep Messages For Days option to zero to disable automatic deletion.

The ThinkAutomation Server performs message store maintenance on a daily basis based on the times specified in the Server Settings - Message Store - Run Message Store Database Maintenance At setting. When Automations or Solutions are deleted via the Studio, ThinkAutomation marks the messages in the message store for deletion during the next maintenance run.

Messages in the Message Store provide an audit trial of messages processed. To maintain best performance you should only keep processed messages for a long as you need to.


Performance Tips

Logging Level

For fast running Automations, or Automations that generate many log entries, you should add a Set Logging Level action to the start of your Automation, with the logging level set to 'minimal'. This will significantly increase performance and reduce the Message Store database size.

Concurrent Automation Processing

By default the Message Processor Service starts 8 separate tasks for Automation processing. Each separate Automation is assigned to one of these tasks. This means that by default 8 Automations can process messages at the same time. If all tasks are processing then new messages will wait in a queue. Messages for each Automation are processed by their assigned task one at a time in the order that messages are received.

You can increase the number of tasks that the Message Processor Service uses in the Server Settings - Message Processor.

Increasing the number of tasks may or may not provider better performance. It depends on how ThinkAutomation is used and the processor capacity available. If you have a small number of Automations that process many thousands of messages per day then increasing the number of tasks will in most cases not make any difference. If however you have many Automations processing a few hundred messages per day each at ad-hoc times (for example - Web Forms) then increasing the number as tasks will provide a faster response time during busy periods.

Increasing the number of tasks will also increase the memory usage of the Message Processor Service.

Individual Automation Concurrent Processing

Specific Automations can also be flagged to Allow Concurrent Execution (set on the Automation Properties tab). This setting defines if messages for the SAME Automation should execute concurrently. This option is disabled by default on new Automations. In most cases you should not need to enable this. If this option is enabled then messages for the same Automation may be processed in a different order than they were received (or more specifically, message 1 may complete before message 2). You should also ensure that your Automation is not updating anything that does not allow concurrent write access. For example: If your Automation updates an Excel file - if one or more messages are executing at the same time the Excel file may block access because it is already open.

Message Store Database

Use a local (installed on the same computer as ThinkAutomation) SQL Server, MySQL, PostgreSQL or Mongo DB Message Store types for best performance. The built-in SQLite Message Store database may give better performance than a remote SQL Server database (depending on your configuration and existing database load).

The built-in SQLite database will provide adequate performance and requires no external database. The ThinkAutomation computer will use less memory overall compared to a locally installed external database. If you are processing ~1000 messages per day or less, then the built-in database will be suitable.

Only keep messages in your Message Store database for as long as you need to. The Keep Messages For (Days) entry on the Solution properties controls how long messages are stored. ThinkAutomation will automatically delete old messages each day. If you are processing many thousands of messages per day but do not remove old messages then your Message Store database will eventually become slower. Also remember that if you use the free version of SQL Server (SQL Server Express) - that this has a limit of 10gb per database.

If you use a shared remote database server for your ThinkAutomation Message Store then you should ensure that this database is available at all times. The ThinkAutomation server checks if the message store database is available every 30 seconds. If it is not available it will pause processing until the database comes back online.

Sending Bulk HTML Emails

If you need to repeatedly send a complex HTML email (eg: A marketing style email with many styles/images etc) you should prepare the HTML file beforehand and save it to a file. All CSS stylesheets should be converted to inline styles for maximum email client compatibility. Using the Send Email action, you have the option to Embed Images and Convert CSS To Inline Styles. However these operations are time consuming - and if you are using the Automation to send the same email many times it will be resource intensive. It will be faster to use the Use External File Or URL For HTML option to reference a local HTML file (not URL). The HTML in the file can still contain %variable% replacement markers.

Slowing Down Processing

Sometimes your Automation may execute too fast - for example if posting to an external API or hosted CRM that enforces rate limits. In these cases you can use the Sleep custom action (available in the Custom Action On-Line Library) to slow down the Automation. Place this action anywhere in your Automation.


CRM Connection Notes

The Get CRM Entity and Update CRM Entity actions can connect to Microsoft Dynamics (Online), Salesforce, Zoho CRM and Sugar CRM.

For other CRM systems, check if your CRM system provides a REST API. If so you can use the HTTP Get and HTTP Post actions to integrate directly. Alternatively there may be an ODBC driver available (see: ODBC Data Sources).

Microsoft Dynamics (Online)

The Dynamics URL should be the Dynamics instance you are connecting to. Normally this would be:

https://{your_company}.crm4.dynamics.com

Select the Connection Method. This can either be Username/Password or OAuth. OAuth is the recommended connection method.

Username/Password

The Username would be your Dynamics/Office 365 username.

For the Password - this will either be your Dynamics/Office 365 password, or an 'app password' - depending on your security setup. App passwords are required if you have enabled two-factor authentication for the user you want to connect with. App passwords are generated via your Office 365 portal. See: How to manage app passwords - Azure Active Directory | Microsoft Docs

Note: It may take a few minutes before a new App Password can be used.

OAuth

Click the Sign In button to sign in to your Dynamics instance.

Microsoft Dynamics (On-Premises)

The built-in CRM actions do not support Dynamics On-Premises. We have created a custom action for reading/updating Microsoft Dynamics On-Premises. Search for 'Dynamics' in the Custom Action on-line library.

Salesforce

The Salesforce Host would normally be login.salesforce.com or login.database.com or region specific (eg: eu30.salesforce.com).

Specify your Username and Password.

The Security Token is an automatically generated key that is used for logging in to Salesforce from an untrusted network. To get your security token, login to SalesForce.com, go to Setup, and under "My Personal Information" click on Reset My Security Token. The security token will be delivered to the email address associated with your account.

See: Object Reference for Salesforce and Lightning Platform | Standard Objects for details of the standard Salesforce object types (Entities).

Zoho CRM

First select your Zoho Domain. For USA select Zoho.com. If your Zoho CRM is hosted in EU, India, Australia or China, you need to specify the corresponding domain: Zoho.eu, Zoho.in, Zoho.com.au or Zoho.com.cn.

Click the Sign In button to complete the sign in process.

Sugar CRM

Enter your Login URL, Username & Password.

The Login URL will be your specific Sugar URL.


Database Connection Notes

ThinkAutomation supports native access to the following database types:

  • Microsoft SQL Server
  • Microsoft SQL Server Azure
  • MySQL / Maria DB
  • SQLite
  • Oracle
  • PostgreSQL
  • DB2
  • Firebird
  • Microsoft Access
  • MongoDB

In addition it can also connect to an ODBC DSN and use any OLEDB driver.

For all database types you can either specify the connection string directly or click the ... button on the Connection String entry to use the Connection String Builder.

SQL Server

Set the Instance to the name or network address of the instance of SQL Server to connect or use '(local)' for the local instance. An optional port number can be specified after the name (eg: 'MySQLServer, 1433'). To force a protocol add one of the prefixes - tcp, np or lpc. eg: 'tcp:servername'.

SQL Server Azure

Set the Server to the address of your Azure Database followed by comma port number. Eg: 'mydatabase.database.windows.net,1433'

MySQL

If you use MySQL for the ThinkAutomation Message Store or if you are using ThinkAutomation to store very large records you may need to increase the max_allowed_packet option on your MySQL server, as a single record may be too large for an Insert. See Packet Too Large.

Microsoft Access

Before connecting to a Microsoft Access database you need to install the Microsoft Access Database Engine. Go to: https://www.microsoft.com/en-us/download/details.aspx?id=54920 and install the 64 bit engine (accessdatabaseengine.exe). Office does not need to be installed, however if Office is installed on the ThinkAutomation computer it will need to be the 64 bit version.

IBM DB2

Before connecting to a DB2 database the IBM Data Server Runtime Client must be installed. The IBM Data Server Driver package can be downloaded here. The IBM.Data.DB2.dll IBM DB2 .NET Data Provider library must be in the global path or copied to the ThinkAutomation program files folder.

Copy the \Program Files\IBM\IBM DATA SERVER DRIVER\bin\netf40\IBM.Data.DB2.dll file to \Program Files\ThinkAutomation\ folder or add C:\Program Files\IBM\IBM DATA SERVER DRIVER\bin\netf40\ to your PATH environment variable (you will need to restart the computer after adding the path).

OLEDB

ThinkAutomation can connect to any OLEDB data source configured on your machine. The connection string must use 'OLE DB Provider=providername' not 'Provider=providername'. This is because ThinkAutomation uses 'Provider=' internally to indicate the database type.

MongoDB

ThinkAutomation can read and update documents from MongoDB databases. This can be any locally installed MongoDB or cloud based MongoDB compatible document databases such as MongoDB Atlas, Amazon DocumentDB or Azure Cosmos DB.

ODBC Data Sources

To connect to an ODBC data source. First, ensure the required ODBC driver is installed. Configure a System DSN using the Windows ODBC Data Source Administrator. When connecting to the database in ThinkAutomation, select ODBC as the Database Type and enter the DSN name created earlier. ODBC drivers are available for many database types.

Parker Software can supply high performance ODBC drivers that work with ThinkAutomation for the following data sources and cloud based services:

  • FreshBooks
  • Magento
  • Mailchimp
  • NetSuite
  • QuickBooks
  • SAP ASE
  • Asana
  • Amazon Redshift
  • Google BigQuery
  • Confluence
  • HubSpot
  • WooCommerce
  • Jira
  • Zendesk
  • Shopify
  • Stripe
  • Slack
  • FoxPro/xBase/Interbase
  • plus many more....

Please contact us for details and pricing.

SQL Identifiers

Universal Quoting Of Identifiers

All database servers support quoting for identifiers that contain special symbols like spaces or dots. ThinkAutomation allows you to wrap identifiers universally so that quotation is appropriate for every database server. Use the following syntax:

"identifier" For example, expression "table1"."field1" turns into "table1"."field1" in Oracle and PostgreSQL, into [table1].[field1] in MS SQL Server, and into `table1`.`field1` in MySQL server. Do not confuse with single quotes, which are intended to wrap string constants.

Comments

Comments are inserted with two hyphens (comments out the text till the end of current line). For multiline comment, wrap it into /.../ sequences. Example:

--This is a single-line comment

/*This one
  spans over
  several lines*/

Date And Time Constants

When using date/time constants in SQL statements the parts of date are separated with hyphen, time parts are separated with colon, and space is expected between the two parts. The following table illustrates date/time format:

Literal Type Format Example
date yyyy-mm-dd {date '2022-01-01'}
time hh🇲🇲ss {time '23:59:49'}
timestamp yyyy-mm-dd hh🇲🇲ss {timestamp '2022-01-01 09:00:00'}

The following SQL statement:

SELECT * FROM emp WHERE HIREDATE>{date '1982-01-15'}

in MySQL evaluates to

SELECT * FROM emp WHERE HIREDATE>CAST('1982-01-15' AS DATETIME)

and in Oracle to

SELECT * FROM emp WHERE HIREDATE>TO_DATE('1982-01-15', 'YYYY-MM-DD')


Embedded Document DB Notes

ThinkAutomation includes an embedded server-less document database that you can use to store any arbitrary data in Json format. Data can then be queried using SQL statements. See the Embedded Data Store action. Files can also be stored and retrieved using the Embedded Files Store action. Simple key/value pair storage can also be stored using the Embedded Value Store action.

The Embedded database enables fast and easy storage & retrieval of data & files in your Automations without any additional setup.

The ThinkAutomation Embedded Document DB is similar to Mongo DB in how it operates, but requires no setup. The Embedded Database is 'schemaless' meaning the schema does not need to be pre-defined.

It uses LiteDB internally. LiteDB is a free serverless database that can be used in .NET projects enabling you to access the ThinkAutomation embedded databases from your own applications.

Limits

  • Each document (record) is limited to 16mb in size.
  • Any number of databases.
  • Unlimited number of documents per collection.
  • Up to 250 indexes per collection.
  • The total size of all the collection names in a database is limited to 8000 bytes. If you plan to have many collections in a single database, make sure to use short names for your collections. For example, if collection names are 10 bytes in length, you can have 800 collections in the database.

See: https://www.litedb.org for more information.

Database Files Location

Actual database files are created when a database is first accessed. One file for each database name. Files are located in the \ProgramData\Parker Software\ThinkAutomation.NET\EmbeddedStore\ folder. Databases are global to your ThinkAutomation instance (IE: The same database can be accessed from any Automation in any of your Solutions).

Encryption

Database files can be encrypted (using AES) by specifying a password. Once a database has been created its password cannot be changed. If you need to change a password, you should create a new database and re-add the data.

Inserting Data

Data is inserted in Json format. Each 'record' is a Json Document. Each document must have an '_id' field with a unique value. If the '_id' field is not supplied then it will be added automatically with a new unique value.

For example, if two documents are added to a collection called 'Person':

{
  "BusinessEntityID": 1,
  "PersonType": "EM",
  "NameStyle": false,
  "Title": null,
  "FirstName": "Ken",
  "MiddleName": "J",
  "LastName": "Sánchez",
  "Suffix": null,
  "EmailAddress": "ken@testcompany.com"
}
{
  "BusinessEntityID": 2,
  "PersonType": "EM",
  "NameStyle": false,
  "Title": null,
  "FirstName": "Terri",
  "MiddleName": "Lee",
  "LastName": "Duffy",
  "Suffix": null,
  "EmailAddress": "terri@testcompany.com",
  "AdditionalContactInfo": null
}

A SQL select statement can then be used:

SELECT _id,EmailAddress FROM Person

Which would return:

[
  {
    "_id": "61483e2213d7e52e0023f4ee",
    "EmailAddress": "ken@testcompany.com"
  },
  {
    "_id": "61483e2213d7e52e0023f4f0",
    "EmailAddress": "terri@testcompany.com"
  }
]

When using SQL you can also return the data as CSV, which for the above would return:

61483e2213d7e52e0023f4ee,ken@testcompany.com
61483e2213d7e52e0023f4f0,terri@testcompany.com

You could also return a single document:

SELECT EmailAddress FROM Person WHERE LastName = 'Duffy'

If using the CSV return type, this would return a single value 'terri@testcompany.com'

In the above example, you could use the Ensure Indexed option on the Insert to add an index to 'LastName' to provide faster queries.

Viewing Data Using The Studio

In the Studio, select File - Embedded Data Browser, or from any of your Embedded Data Store actions within any Automations click the Browse Data button. This will open the Embedded Database Browser.

You can select any of your Databases/Collections to execute SQL SELECT statements to view your data. Click the Run button to execute. The results will be displayed. Click the Print/Export button to print or export the data locally.

SQL Statement Syntax

SELECT statement

SELECT <field> [,field]
[FROM <collectioname>]
[WHERE <filter>]
[GROUP BY <field>]
[ORDER BY <field> [,field] [ASC | DESC] ]
[LIMIT <number>]
[OFFSET <number>]

You can use aggregate functions:

COUNT(), MIN(), MAX(), FIRST(), LAST(), AVG(), SUM()

Date Functions:

YEAR(value), MONTH(value), DAY(value), HOUR(value), MINUTE(value), SECOND(value), DATEADD(dateInterval[year,month,day,hour,minute,second], amount, value), 
DATEDIFF(dateInterval, start, end), TO_LOCAL(date), TO_UTC(date)

String Functions:

LOWER(value), UPPER(value), LTRIM(value), RTRIM(value), TRIM(value), INDEXOF(value, match [,start]),  SUBSTRING(value, startIndex [,length]), LPAD(value, totalWidth, paddingChar), RPAD(value, totalWidth, paddingChar), FORMAT(value,format), LENGTH(value)

GROUP BY

If this clause is present, the results are grouped by a field and the query returns a document for each group. Please note that only one grouping field is allowed.

UPDATE statement

UPDATE <collectionname> SET <field> = <value> [,<field> = <value>]
WHERE <filter>

DELETE statement

DELETE <collectionname> 
WHERE <filter>

HTML Parsing Notes

ThinkAutomation includes a number of options to make parsing HTML content easier.

When an incoming message is received, if the message is an email and the body has no plain text portion then the %Msg_Body% built-in variable will be automatically created as a plain text version of the HTML body. The %Msg_HTML% built-in variable will contain the HTML original.

The Set Variable action and the Text Operation actions have options to convert HTML To Plaintext, XML or JSON. These operations are the same for both of these actions, however the Text Operation action has the option of previewing the result, allowing you to test the conversion.

HTML To Plain Text

Converts any HTML content into plaintext. All HTML tags are removed resulting in only the text content that would have been displayed.

For Example:

<html>
    <head>
        <title>This is a test</title>
        <meta http-equiv="Content-Language" content="en-us">
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>
    <body>
        <h1>This is the heading</h1>
        <p>This is a sample paragraph with <b>bold</b> text<br> and a line below.
        <p>Sample link to <a href="http://www.google.com/">Google</a></p>
    </body>
</html>

Becomes:

This is the heading

This is a sample paragraph with bold text
and a line below.

Sample link to Google
<http://www.google.com/>

HTML To XML

Converts any HTML into well-formed XML for easier extraction of data. All formatting tags, styles, images & scripts are removed.

For example, the above HTML would be converted to:

<?xml version="1.0" encoding="utf-8"?>
<root>
    <html>
        <head>
            <title>
                <text>This is a test</text>
            </title>
        </head>
        <body>
            <h1>
                <text>This is the heading</text>
            </h1>
            <p>
                <text>This is a sample paragraph with bold text and a line below.</text>
            </p>
            <p>
                <text>Sample link to</text>
                <a href="http://www.google.com/">
                    <text>Google</text>
                </a>
            </p>
        </body>
    </html>
</root>

HTML To JSON

Converts any HTML to Json text. The HTML is first converted to XML and then from XML to Json.

For example, the above HTML would be converted to:

{
  "html": {
    "head": {
      "title": {
        "text": "This is a test"
      }
    },
    "body": {
      "h1": {
        "text": "This is the heading"
      },
      "p": [
        {
          "text": "This is a sample paragraph with bold text and a line below."
        },
        {
          "text": "Sample link to",
          "a": {
            "@href": "http://www.google.com/",
            "text": "Google"
          }
        }
      ]
    }
  }
}
  • Character data, comments, whitespace and significant whitespace nodes are accessed via #cdata-section, #comment, #whitespace and #significant-whitespace respectively.
  • Multiple nodes with the same name at the same level are grouped together into an array.
  • Empty elements are null.

Once converted to Json you can use the Extract Field or Read JSON Document actions to extract data at specific paths.


Local Server Limitations

Any number of Solutions can be created. Each containing any number of Message Sources and Automations. The ThinkAutomation Services load all Solutions in memory.

There is no limit to the number of messages that can be processed. The only limit is available memory and processor capacity.

Note: The ThinkAutomation Basic edition has a limit of 10 message sources and 500 processed messages per day. Standard & Professional Editions have no limits.

The effective maximum number of active Message Sources & Automations is determined only by available memory and processor capacity. Each Message Source executes concurrently. So if you created 10 Message Sources to download messages from 10 separate Office 365 accounts then each will process at the same time. The Automations executed from these Message Sources also execute concurrently (up to the maximum defined in the Server Settings - Message Processor - Message Processor Tasks) as each new message arrives.

For high volume ThinkAutomation implementations you should monitor the memory & processor usage of the ThinkAutomation services. If you are using the Professional Edition then the Message Reader and Message Processor services can be configured to run on separate computers and multiple instances of the Message Processor service can be configured to share the processing.

The Message Store can store a unlimited number of processed messages - limited only by the database type being used. Each message can be any size - but with an effective limit of 50mb per message. For all editions you can run the Message Store database on a separate computer if required.

Individual Automations are limited to 16mb in metadata size - which equates to many thousand Actions per Automation. Large Automations can be split into separate Automations and called using the Call action type.

High Volume Processing Notes

When a new incoming message is received, the ThinkAutomation Server adds the message to an in-memory queue. Messages are then written to the Message Store database from this queue. The in-memory queue is limited to 500mb (or max n messages - where 'n' is based on available memory). If the queue gets to 70% capacity the ThinkAutomation Server notifies the Message Reader services to slow down (throttle). Messages will be added more slowly until the queue gets back to 20% capacity. A message will be added to the server log whenever throttling is enabled.

The main bottleneck for high volume processing is the speed at which the ThinkAutomation server can write new messages to the Message Store database. For high-volume implementations the type and location of the Message Store database will be the main performance factor. For instance, a local SQL Server database will be faster than a remote one. A MongoDB database will give the best performance provided it is local (or on another computer on the same network) and has sufficient memory.

A typical ThinkAutomation installation on a computer with an i7 processor and 16GB ram with the Message Store database running on the same computer can process 200-300 messages per second (assuming a basic Automation and incoming message size of 1k and no other high CPU intensive applications running).

The speed at which individual Automations can process messages obviously depends on the Automation itself.

You should also ensure that processed messages are removed from the Message Store database when you no longer need to keep a copy. Message removal days are specified on the Solution properties. The ThinkAutomation server removes old messages on a daily basis.

You can view the current queue status and queue size by viewing the ThinkAutomation Server Status web page. Open a browser to http://localhost:9899 on the ThinkAutomation Server computer.


Json Notes

Creating Json

Json text can be created using the Create Json, Update Json or Set Variable actions.

The Create Json action is useful where you have a pre-defined Json schema and you want to assign values to specific paths and then return the resulting Json to a variable. It maintains the data type (string, date, boolean, number) of the pre-defined schema.

The Set Variable action allows ad-hoc creation of Json - but you need to add quotes for string values. For example, if we had the following Json:

{
    "Name": "",
    "Email": "",
    "StartDate": "",
    "Age": 0
}

And we wanted to set a value and include %variable% replacements, eg:

{
    "Name": "%Name%",
    "Email": "%Email%",
    "StartDate": "%StartDate%",
    "Age": %Age%
}

Any string %variable%replacements that are strings or dates must be enclosed in quotes.

The Set Variable action has a 'Convert: Reformat Json' operation which will reformat, and re-indent the Json (after the %variable% replacements).

Updating Json

The Update Json action is useful where you want to create or update Json and set the values of specific paths. Any existing paths in the Json that are not updated will retain their existing values. Any paths updated that do not already exist in the existing Json will be added.

Json Variable Replacements

When an Automation executes, any %variable% replacements inside Json text will be correctly 'escaped' - unless the replace value itself is already Json. Any Extract Field values that are set as 'Date' type, or any built-in variables that are dates (%Msg_Date%, %Date% etc.) will be replaced in ISO 8601 format.

Built In Json Variables

%Msg_Json%

This built-in variable will return Json text representing the current message being processed. For example:

{
    "MessageId": "12c1c473-862d-44f1-9dc7-cbf0474fba12",
    "Subject": "Test Subject",
    "Dated": "2021-09-23T10:49:55+01:00",
    "BodyPlainText": "Test Body",
    "BodyHTML": "",
    "From": [
      {
        "Email": "howard.williams@parkersoftware.com",
        "Name": "Howard Williams"
      }
    ],
    "ToAddress": [
      {
        "Email": "stephen@parkersoft.co.uk",
        "Name": ""
      }
    ],
    "CC": null,
    "BCC": null,
    "Sender": null,
    "ReplyTo": null,
    "InReplyTo": null,
    "References": "",
    "ReturnPath": "",
    "MessageHeaders": [
      {
        "Header": "MIME-Version",
        "Value": "1.0"
      },
      {
        "Header": "Date",
        "Value": "Thu, 23 Sep 2021 10:49:55 +0100"
      },
      {
        "Header": "Message-Id",
        "Value": "12c1c473-862d-44f1-9dc7-cbf0474fba12"
      },
      {
        "Header": "Content-Type",
        "Value": "text/plain; charset=us-ascii; format=flowed"
      },
      {
        "Header": "Content-Transfer-Encoding",
        "Value": "7bit"
      },
      {
        "Header": "X-Priority",
        "Value": "3 (Normal)"
      },
      {
        "Header": "To",
        "Value": "stephen@parkersoft.co.uk"
      },
      {
        "Header": "From",
        "Value": "Howard Williams <howard.williams@parkersoftware.com>"
      },
      {
        "Header": "Subject",
        "Value": "=?us-ascii?B?SnNvbiBSZXBsYWNl?="
      }
    ],
    "ContentType": "text/plain; charset=us-ascii; format=flowed",
    "ContentTransferEncoding": "7bit",
    "CharSet": "us-ascii",
    "Language": "latin1",
    "OrigDate": "2021-09-23T10:49:55+01:00",
    "Size": 356,
    "ReadReceipt": false,
    "Importance": "NORMAL",
    "Sensitivity": "NORMAL",
    "Attachments": null,
    "RelatedItems": null,
    "SolutionId": "60e2e90913d7e55818292ddb",
    "MessageSourceId": "613b33bb13d7e531e41aa54f",
    "AutomationId": "614c3f5413d7e531b004b412",
    "MessageStoreId": "613b33bb13d7e531e41aa54f"
  }

%Msg_ExtractedFieldsJson%

This variable will return Json text containing the name and value for each Extract Field action. For example, suppose you have created the following Extract Field actions:

  • From = Extract Field Built-In Variable %Msg_FromEmail%
  • Size = Extract Field Built-In Variable %Msg_Size%
  • Dated = Extract Field Built-In Variable %Msg_Date%
  • Body = Extract Field Built-In Variable %Msg_Body%

The %Msg_ExtractedFieldsJson% built-in variable would return:

{
  "From": "howard.williams@parkersoftware.com",
  "Size": 355,
  "Dated": "2021-09-23T11:00:52Z",
  "Body": "Test Message"
}

You can define the field type for each Extracted Field on the Extract Field action - Database Update Tab - Field Type.

The %Msg_ExtractedFieldsJson% variable is useful when used with the Embedded Data Store action. You can set the Insert json to this variable to insert your extracted fields into an easy to use data store that you can query on from other Automations.

Extracting From Json

There are a number of ways to extract data from Json text.

Extract Field Action

You can use the Extract Field action to extract a specific Json path value. If the Extract Field From value contains Json text then you can enable the Extract Json Path option and then enter or select a path. If you paste some sample Json into the Helper Message the path list will be populated. You can also extract Json array values to a CSV string.

Read Json Document

The Read Json Document action can be used to read Json from a web resource or specify Json Text manually (or a %variable% replacement read from an earlier action). You can then extract multiple paths and assign the values to variables.

InLine Function

The InLine function option allows you to extract a specific Json path value without creating an action. Simply use the InLine function as you would any other %variable% replacement.

You can use the %func%:JsonValue inline function to extract a specific Json path value. For example, if you have a variable called 'AddressJson' set to:

{ 
  "employee": { 
    "name": "John",  
    "salary": 56000,  
    "married": true 
   } 
} 

You could use the inline function such as:

Dear %func%:JsonValue(%AddressJson%,"employee.name"),

At runtime the replaced text would be:

Dear John,

Extracting And Looping Through A Json Array

The Extract Field action allows you to extract at a specific Json path. If this path is an array you can enable the Extract All Array Values To CSV option.

For example, suppose you have the following Json:

{
  "Actors": [
    {
      "name": "Tom Cruise",
      "age": 56,
      "Born At": "Syracuse, NY",
      "Birthdate": "July 3, 1962",
      "photo": "https://jsonformatter.org/img/tom-cruise.jpg"
    },
    {
      "name": "Robert Downey Jr.",
      "age": 53,
      "Born At": "New York City, NY",
      "Birthdate": "April 4, 1965",
      "photo": "https://jsonformatter.org/img/Robert-Downey-Jr.jpg"
    }
  ]
}

You could create an Extract Field action and set the Path to Actors and enable the Extract All Array Values To CSV option.

The Extract Field value would be set to:

Tom Cruise,56,"Syracuse, NY","July 3, 1962",https://jsonformatter.org/img/tom-cruise.jpg
Robert Downey Jr.,53,"New York City, NY","April 4, 1965",https://jsonformatter.org/img/Robert-Downey-Jr.jpg

You can then use the For..Each action to loop over each line in the returned CSV and within the loop use the Parse CSV Line action to get specific values.

Looping Through Json Member Values Using For..Each

You can use the For Each action to loop on Json members. For example, the following Json:

{ 
  "employee": { 
    "name": "John",  
    "salary": 56000,  
    "married": true 
   } 
} 

In the For..Each action set the For Each to Json Member In and set the Json In to a %variable% containing the Json. With the Start At Path set to employee.

You can assign each member value and name to variables.

The above loop would set the variables:

%name%=name, %value%=John
%name%=salary, %value%=56000
%name%=married, %value%=true

Array example:

["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 

Using a For..Each action on the above Json. The values assigned would be 'Sunday','Monday'.. etc.

Array Example 2:

{
    "id": "0001",
    "type": "donut",
    "name": "Cake",
    "ppu": 0.55,
    "topping":
        [
            { "id": "5001", "type": "None" },
            { "id": "5002", "type": "Glazed" },
            { "id": "5005", "type": "Sugar" },
            { "id": "5007", "type": "Powdered Sugar" }
        ]
}

Using a For..Each on the above Json with the Start At Path set to topping. The values in the loop would be assigned:

{
  "id": "5001",
  "type": "None"
}
{
  "id": "5002",
  "type": "Glazed"
}

etc.

If you set the Start At Path to topping[0] then this will iterate through the first array item in the topping array.

Converting Json To HTML

You can convert Json text to human readable HTML using the Convert Json To HTML action.

This action us useful when you read Json data from a database, web resource or web api etc., and you need to easily convert the content to readable HTML. The HTML can then be included on outgoing emails or used as a return value for webform Message Sources.

Converting Json To XML

You can convert Json text to XML (and XML To Json) using the Set Variable action with the Convert: JSON To XML operation (or Convert: XML To Json) operation.


Markdown Notes

Markdown is a lightweight markup language with plaint-text formatting. See: Markdown Guide

You can use Markdown in ThinkAutomation for outgoing email text, Teams Messages, Web Forms and Wait For User Response forms (headings, prompt text, help text). You can also use it with the Set Variable action. The Set Variable action has an option for converting Markdown to HTML and for converting CSV data to a Markdown table.

For example: If you set an outgoing plain text email or Teams message to:

# Order Received
Please find below your order:

Order: **1234**
Link: [View Order](https://mycompany.com/orders/1234.pdf)

The outgoing email HTML would convert to:

<h1 id="order-received">Order Received</h1>
<p>Please find below your order:</p>
<p>Order: <strong>1234</strong><br />
Link: <a href="https://mycompany.com/orders/1234.pdf" target="_blank">View Order</a></p>

For outgoing emails any converted HTML will be wrapped inside <html> & <body> tags. A basic CSS stylesheet will be applied. The CSS can be edited in the Server Settings - Default CSS.

Any of the standard Markdown formatting can be used. See: https://www.markdownguide.org/basic-syntax

Tables

For tables you can use Pipe format or Grid format.

Pipe Format

| abc | def | ghi |
|:---:|-----|----:|
|  1  | 2   | 3   |

Would convert to:

<table>
<thead>
<tr>
    <th style="text-align: center;">abc</th>
    <th>def</th>
    <th style="text-align: right;">ghi</th>
</tr>
</thead>
<tbody>
<tr>
    <td style="text-align: center;">1</td>
    <td>2</td>
    <td style="text-align: right;">3</td>
</tr>
</tbody>
</table>

Or..

# Details

| Item    | Details           |
| ------- | ----------------- |
| From    | **%Msg_From%**    |
| To      | **%Msg_To%**      |
| Subject | **%Msg_Subject%** |

Would convert to:

<h1>Details</h1>
<table>
<thead>
<tr>
    <th>Item</th>
    <th>Details</th>
</tr>
</thead>
<tbody>
<tr>
    <td>From</td>
    <td><strong>sender@test.com</strong></td>
</tr>
<tr>
    <td>To</td>
    <td>receiver@test.com</td>
</tr>
<tr>
    <td>Subject</td>
    <td><strong>Test Subject</strong></td>
</tr>
</tbody>
</table>

Pipe style tables must have a blank line before and after the table.

Grid Format

A grid table allows you to have multiple lines per cells and cells can span over multiple columns. For example:

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

Alignments can be specified as with pipe tables, by putting colons at the boundaries of the separator line:

+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+==============:+:==============+:==================:+
| Bananas       | $1.34         | built-in wrapper   |
+---------------+---------------+--------------------+

For headerless tables:

+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+---------------+---------------+--------------------+

When using multiple lines per cell the column separators must line up.

Converting CSV Data To A Markdown Table

If you have CSV data you can use the Set Variable or Text Operation actions to convert CSV data to a Markdown table. Numeric columns will be right aligned and date columns will be centre aligned.

Any URL will automatically be converted to a link. You can also use the syntax:

[Link Text](http://www.mysite.com)

Would convert to:

<a href="http:/www.mysite.com" target="_blank">Link Text</a>

For images you can use the syntax:

![Logo](http://www.mysite.com/assets/images/logo.png)

Would convert to:

<img src="http://www.mysite.com/assets/images/logo.png" alt="Logo">

Markdown document files or attachments (*.md) can be converted to PDF, Word & HTML files using the Convert Document action.

Returning Markdown

You use use the Automation Return action to return Markdown text. If the Message Source is a Web Form then the Markdown will be automatically converted to HTML before being displayed in the confirmation message.

For manually executed Automations sent by users of the Desktop Connector or Studio (via the Send Message form) then any Markdown content in the Return value will be rendered.


Sentiment Analyzer Control Panel

The Sentiment Analyzer Control Panel is a stand alone application that can be used to test & train the ThinkAutomation Sentiment Analyzer. It can be started by clicking the Open Sentiment Analyzer Control Panel button on the Score Sentiment, Train Sentiment & Classify Sentiment actions or by running the ThinkAutomationSentimentControlPanel.exe application.

You must first login with your ThinkAutomation User Name/Password.

The current Class Names will be listed. Select a Class Name. You can add a new class using the Add button. To clear all training data for a class click the Reset button.

Test Or Train With Text

Select this tab to test or train the currently selected class name with manually entered text.

Enter or paste text into the box. Click the Test button to analyze the text. The sentiment score will be displayed along with Tokens Used and Tokens Scored.

Click Train Positive or Train Negative to add positive or negative training data for the entered text. Click Add Ignore Words to add all tokens from the entered text as Ignore Words. Click Tokenize to just display the extracted tokens without adding training data.

Test With Files

Select this tab to run multiple tests using local files. Select the Positive Files Path for the folder containing files that you expect to score positive and Negative Files Path for the folder containing files that you expect to score negative.

Enter the file Mask (eg: *.txt) or enter *.* for all supported file types. You can use txt, html, csv, eml or msg (Outlook Messages).

Click Run Test to start.

Each file will be scored - and the overall results displayed along with the overall accuracy percentage.

Train With Files

Select this tab to add training data using multiple local files. Select the Positive Files Path for the folder containing files that will be trained as positive and Negative Files Path for the folder containing files that will be trained as negative.

Enter the file Mask (eg: *.txt) or enter *.* for all supported file types. You can use txt, html, csv, eml or msg (Outlook Messages).

Click Run Training to start.

Each file contained in the selected folders will be read, tokenized and the tokens added as either positive or negative training data.

You can use the Test options to run tests after each training operation.

Training Strategy

For best results each Class Name should be trained with roughly the same number of positive and negative messages. Accuracy will improve with more messages trained.

For example, suppose we want to use the Sentiment Analyzer to flag up incoming messages as 'Sales Enquiry'. You would create a 'SalesEnquiry' class name. You then need to obtain roughly the same number of messages that ARE sales enquires and that are NOT sales enquiries. Save these to separate folders on your file system. You can save Outlook messages to these folders. Several hundred at least of each if possible.

Then use the Train With Files option to add the training data.

Now use the Test With Text option and enter some new text that you would consider a Sales Enquiry. The scored result should be POSITIVE. Enter some new text that you would consider NOT a Sales Enquiry. The scored result should be NEGATIVE.

You can also use the Train Sentiment Automation action to add training data. The benefit of the Automation Action is that you can link it to a Message Source to read folders from an email source. For example: You could create email folders for positive/negative messages and move respective email items to those folders. Then create ThinkAutomation Message Sources to read the folders and execute the Train Sentiment action. You can then add new email items to these folders whenever you want to update the training data.

Classification

Classification is the process of finding the most relevant Class Name for any text. For example: Suppose you have two Class Names: "SalesEnquiry" and "SupportEnquiry" and training data has been added for both. Classification can be used on some new text to indicate which Class Name is the most relevant. You can use the Classify button on the Test With Text tab to perform classification tests.


The ThinkAutomation Desktop Connector Application

The ThinkAutomation Desktop Connector is a stand-alone application that you can optionally install on multiple computers on your network. The number of ThinkAutomation Desktop Connectors that can connect to your ThinkAutomation Server at the same time depends on the Edition you have purchased (see: Editions).

Users can use the ThinkAutomation Desktop Connector to manually execute Automations by sending messages or by dragging and dropping files, attachments and Outlook Messages. For example, you may have an Automation that generates a quotation PDF, sends the quotation to the customer and records it in your CRM system. The ThinkAutomation Desktop Connector could be installed on all the sales team computers. Sales team members can then simply drag and drop quote request emails on to the relevant Automation. Automations are executed immediately by the ThinkAutomation server and the results returned back to the Desktop Connector.

The Desktop Connector cannot be used to edit Automations or make any other configuration changes.

The Desktop Connector is installed as part of the main ThinkAutomation installation. A stand-alone Desktop Connector installer is also available here: Download ThinkAutomation Desktop Connector Setup (55mb).

When the Desktop Connector is started the user must login. You can create additional users using the ThinkAutomation Studio - Server Settings - Users tab. Multiple Desktop Connector users can login using the same username if required.

After login the Desktop Connector will list all Automations and Web Form Message Sources for the currently selected Solution. You can change the selected Solution from the drop-down list. You can restrict the Solutions available to a user using the Server Settings.

Sending Messages To An Automation

Click an Automation in the list. The right hand pane will display the Send Message form for the selected Automation. Enter a message and click the Send button (or press CTRL-Enter). You can also change the Subject, From and To addresses and add Attachments.

The message will be processed by ThinkAutomation and the return value (along with any Comments) will be displayed.

Dropping Files

You can drag and drop any file on to the Send Message form. These will be sent to ThinkAutomation for immediate processing. Any text files dropped onto the Desktop Connector will be converted into plain text emails. HTML files will be converted to HTML emails. Email messages (EML files) can also be dropped. Any other file types will be added as an attachment to a plain text email before being sent to ThinkAutomation. You can drag & drop multiple files in a single drag/drop operation. Each file will be treated as a separate message.

Dropping Microsoft Outlook Messages

For users of Microsoft Outlook (desktop version) you can select one or more messages from Outlook itself and drag & drop them onto the Send Message form. You can also drop specific message attachments. These will then be copied and sent to ThinkAutomation for processing and the results displayed. The original messages in Outlook are not changed.

Web Form Message Sources

Any Web Form messages sources for the selected Solution will also be displayed. Selecting one of these will display the the web form inside the Client. You can then complete the form and submit. ThinkAutomation will then process the form results.

Responding To Wait For User Response Actions

The Desktop Connector will display any Wait For User Response action forms. If the Send Request Via Studio & Client Users option is enabled on any Wait For User Response actions, the ThinkAutomation Server will send the validation request to users running the ThinkAutomation Studio or ThinkAutomation Desktop Connector. Studio and Desktop Connector users can complete the validation request from there. You can specify specific Usernames or leave this blank to send to any ThinkAutomation Studio or Desktop Connector users (connected to your ThinkAutomation Server instance).

Viewing The Message Store

The Desktop Connector can also be used to view the Message Store which shows a list of processed messages. Click the View tab. All Automations for the selected Solution will be displayed. Select an Automation to view processed messages. Double-click a message or click the Open button to view the message detail and Automation log.

The View tab will only be available if the logged-in user has the Can View Message Store right enabled.

The ThinkAutomation Desktop Connector connects to the ThinkAutomation Server using a secure websocket on port 9110. Ensure this port is open on the ThinkAutomation Server firewall. You will also need to add any network IP ranges to the Whitelist in the ThinkAutomation Server Settings.


Configuring Self Hosted API Gateway Server

The ThinkAutomation API Gateway Server allows inbound public HTTPS API requests and any public Web Form or Web Chat form responses to be sent to your local ThinkAutomation server. The gateway acts as a secure tunnel between public web requests and your ThinkAutomation Server. The Gateway listens for web requests (HTTPS port 443) and forwards valid requests to your ThinkAutomation Server. Your ThinkAutomation server makes an outbound connection to the Gateway using a secure websocket connection on port 80.

By default, ThinkAutomation connects to 'api.thinkautomation.com', which is a shared API Gateway Server hosted by Parker Software. This works out-of-the-box and requires no setup but provides a restricted number of messages per day (5000 for the Pro edition, 1000 for Standard).

With the ThinkAutomation Professional Edition, you can also host your own instance of the ThinkAutomation API Gateway Server which has no messages per day restrictions and has its own DNS name and SSL certificate. For this you will need a separate Windows Server with a public IP address (or a virtual machine hosted in Microsoft Azure or any other cloud based provider) with its own DNS name and trusted SSL certificate.

Configuration Steps

Important: Firstly, ensure you have the latest ThinkAutomation Server installed. You should not use an old ThinkAutomation Server with the latest Gateway.

  1. Register a DNS name (eg: api.mycompany.com). Add a DNS 'a' record to point this DNS name to the public IP address of your ThinkAutomation Gateway computer.
  2. Obtain an SSL certificate with a common name matching the DNS name. Import this certificate into the Windows Certificate store, or save it as a PFX file.
  3. Download and install the ThinkAutomationGateway.exe setup (Parker Software can provide the download link). No other software is required for the Gateway to work (IIS should not be enabled). Ports 443 and 80 need to be open on any firewalls used or connected to this computer. Once the Gateway is installed, run the ThinkAutomation Gateway Configuration application to setup the gateway.
  4. In the HTTP External Address entry, enter the public DNS name (for example: api.mycompany.com). Click the Select Cert button to select the SSL certificate that is registered to the public DNS name. This can be a certificate selected from the certificate store, or you can select a path to a PFX file.
  5. Click Save to save the settings.
  6. Click the Install button to install the Gateway Service, then click Start to start it. If the service was already installed, you need to stop and restart the service after any changes are made.
  7. Now, go to your ThinkAutomation Server computer and start the Studio. Select File - Server Settings - Web API tab.
  8. Enable the Use Own API Gateway Server option.
  9. Change the Public Address and the Gateway Server Host to the public DNS name.
  10. Change the Gateway Server Host entry to the local IP address or host name of the computer running the Gateway Server.
  11. The Gateway Server Instances Port must match the Instances Connect On Port entry in the Gateway Configuration - ThinkAutomation Instance Connections tab. This defaults to port 80, but can be changed to any available port (ensure this is open on the Gateway computer firewall).
  12. Save the server settings.
  13. Your ThinkAutomation Server should now connect to the new Gateway (it may take a minute or so for your ThinkAutomation Server to reconnect to the new gateway - this can be speeded up by simply restarting your ThinkAutomation Server). You can verify this by checking the ThinkAutomation Server log. All your public ThinkAutomation Message Source API and webform URL's will now point to the new DNS name.
  14. Verify the new endpoints work by making a public API request, or by viewing a webform via it's public address.

Multiple ThinkAutomation Server's can use the same Gateway Server. You can lock down which ThinkAutomation Server's can connect to your gateway by enabling the Instance Connections Must Be In Whitelist option, and then specifying your ThinkAutomation Server's public address in the whitelist.

Viewing The Gateway Status Page

You can view the gateway status page using a browser at https:{gatewaydns}/index.htm (eg: https://api.mycompany.com/index.htm). This page will only be accessible on localhost, or via any IP address in the Gateway Whitelist. If you add IP's to the Gateway Whitelist you will need to restart the Gateway Service for the change to take effect.


Configuring Distributed Setup

The Professional Edition of ThinkAutomation allows the ThinkAutomation main service, Message Reader service and Message Processor service to be configured to run on separate computers. You can also run multiple instances of the Message Processor service on separate computers in a load-balanced configuration (additional license required).

Preparation

You first need to decide on the computer that will run the ThinkAutomation Main Service. Only one computer can run the ThinkAutomation Main Service.

Choose the computers that will run the ThinkAutomation Message Reader Service and the ThinkAutomation Message Processor Service. You can choose to run one or both of these on the same computer as the Main Service or separately.

Configuring The Main Service Computer

Run the ThinkAutomation.exe setup to install ThinkAutomation on the main computer. After the setup is complete the ThinkAutomation Node Configuration application will start.

Select the Distributed Services option and then select the services to run on this computer. The Main Service option must be selected on the main computer.

You should then run the ThinkAutomation Studio to complete the setup of the ThinkAutomation main service. This includes registering your product and completing the Message Store database configuration.

Configuring Node Computers

On a separate computer, run the ThinkAutomation.exe setup again to install ThinkAutomation. After setup is complete the ThinkAutomation Node Configuration application will start.

Select the Distributed Services option and the un-select the Main Service option and select either (or both) the Message Reader Service or Message Processor Service.

You must then enter the IP address of the Main Service computer. Click the Verify button to verify that the computer can connect to the ThinkAutomation main service.

Important

The Message Reader and Message Processor services use ports 9110 and 9899 to communicate with the ThinkAutomation Server. Ensure these ports are open on any firewall on the ThinkAutomation Server computer. Ensure any remote computer IP addresses are added to the ThinkAutomation Server Settings Whitelist.


Configuring A Failover Server

The ThinkAutomation Professional Edition can be configured to act as a failover server for another ThinkAutomation instance. If the main ThinkAutomation Server goes offline, the failover server takes over message processing until the main server is back online.

Preparation

  • Your main ThinkAutomation server should be installed, configured and running.
  • You must use SQL Server, MySQL, PostgreSQL or MongoDB as your Message Store database.
  • The database must be available to the computer that will run the failover instance of ThinkAutomation. The database server would normally be on a separate computer to the ThinkAutomation main server.
  • The Backup Solution Settings In Message Store option must be enabled in the main ThinkAutomation server settings.
  • On the main ThinkAutomation server ensure the failover server IP address is in the Whitelist (Server Settings - Clients - Whitelist IP Addresses).
  • On the main ThinkAutomation server ensure port 9899 is open for inbound connections (from the failover server) on any firewalls.

Setting Up

On a separate computer, run the ThinkAutomation.exe setup again to install ThinkAutomation. After setup is complete the ThinkAutomation Node Configuration application will start.

Select the Failover Server option and click Next. You will then need to register this instance. Enter your registration details and serial number and click Next. You cannot use the same serial number that has been used to register the main ThinkAutomation instance.

You must then enter the computer name or IP address of the main ThinkAutomation computer. Click the Verify button to verify that the computer can connect to the ThinkAutomation main service.

Enable the Automatic Failover option if you want this instance to automatically monitor the main ThinkAutomation Instance.

How It Works

The failover ThinkAutomation server connects to the main ThinkAutomation server every few seconds to verify that it is running. If the main server cannot be reached (after a couple of retries) the failover server restores all current Solution and global settings from the Message Store database backup and starts processing. Once the main server comes back online it stops processing and reverts to its waiting state.

During failover you can use the Studio to connect to the failover server to view processing status and to view the Message Store - however you cannot make changes to any settings.

Manual Failover

If the Automatic Failover option is not enabled then the failover instance of ThinkAutomation will not start processing if the main server cannot be contacted. You must enable the failover server manually. To do this, start the ThinkAutomation Studio on the failover server. After logging in you will be asked if you want to enable the failover. The failover server will still stop processing if the main server comes online even if Automatic Failover is disabled.

Note: If you use any Counter or Embedded Data actions in your Automations then you must configure a shared location for the embedded database files. This is done using the EmbeddedStorePath registry key. This should be set to a path that is accessible by both the main ThinkAutomation Server and the Failover Server.

Parker Software can assist you in setting up a fault-tolerant, load-balanced ThinkAutomation implementation with failover. Please contact our Professional Services team for more information.


Installing The ThinkAutomation Studio On Remote Computers

You can install and use the ThinkAutomation Studio on any remote computer that can access the ThinkAutomation Server.

Run the ThinkAutomation.exe setup on the remote computer.

When the ThinkAutomation Node Configuration starts after installation, select Studio Only.

Start the ThinkAutomation Studio and set the ThinkAutomation Server to the IP Address or computer name of the ThinkAutomation Server computer.

The number of Studio & Client users that can be connected to the ThinkAutomation Server at any one time depends on the edition. Standard Edition supports 2 active Studio users, Professional Edition supports up to 10.

Important

If you will be connecting to the ThinkAutomation Server from an external host (for example, if your ThinkAutomation Server is hosted on a cloud virtual machine) you will need to add the remote IP address to the ThinkAutomation Server Whitelist. This needs to be done on the ThinkAutomation Server computer. Use the Studio on the server computer - Server Settings - Clients - Whitelist IP Addresses. Add the External IP addresses for any ThinkAutomation Studio or Client users.

You may also need to configure any firewalls on the ThinkAutomation Server computer to accept inbound requests on port 9110 and 9899.


Running The Message Processor Service Under A Different User

By default the ThinkAutomation Message Processor service runs under the local SYSTEM account. By default this account will not have access to any network resources (Printers, Network Drives, Remote paths etc). Therefore, if you want an Automation to update files, save attachments or access any network resource you must run the ThinkAutomation Message Processor service under a different user.

To do this, first stop the ThinkAutomation Services (click the Windows Start button and search for 'services' - select the Services app). Scroll down to ThinkAutomation Message Processor. Select and right-click and click Stop.

Right-click the ThinkAutomation Message Processor service and select Properties. Click the Log On tab. Un-select the Local System Account option and select This account. Select a local user account that has access to the network resources that you want ThinkAutomation to be able to access. Enter the password and confirm it.

Click OK.

Restart the ThinkAutomation Message Processor service. It should now be able to access network resources during Automation execution.


TACopy Command Line Utility

The TACopy.exe utility is a command line application that can be used to send messages to ThinkAutomation for processing. It can be run from the command prompt or executed from other applications (such as Windows Task Scheduler, PowerShell, Batch Files or Macro Playback software etc). TACopy can be run on any network computer that can access the ThinkAutomation Server.

TACopy can send plain text messages, files, emails and Outlook messages. Multiple files can be sent in a single operation - with each file being sent to ThinkAutomation as a separate message.

Usage

tacopy {command} [parameter] [/m messagesourceid] [/a automationid] [/w]
                             [/s "subject text"] [/f fromaddress] [/t toaddress] [/b "body text"]
                             [/i serverNameOrIP[:port]]

The /i switch is used to specify the IP address or computer name of the computer running the ThinkAutomation Server. If this is not specified then localhost is assumed.

Commands

Command Details
status Displays the ThinkAutomation Server status.
list Displays a list of Message Sources & Automations along with their ID's.
send Sends messages to ThinkAutomation for processing.

The Send command can be used to send a plain text message - by specifying the body text as part of the command line, or it can read and send files. For plain text or HTML files the content of the file is used as the body of the message. For email files (.eml) and Microsoft Outlook messages (.msg) the complete email is sent including attachments. For any other type of file will be sent as an attachment to a plain text email.

The /m switch must be specified followed by a valid Message Source Id. The message will then be processed by the default Automation assigned to the Message Source. You can optionally also specify an Automation Id (/a) if you want to execute a specific Automation (within the same Solution). You can find the Message Source/Automation Id's using the list command, or they can be viewed in the ThinkAutomation Studio.

For send commands you can optionally include the /w switch. If the /w switch is included then TACopy will wait for the Automation to complete before showing the Return Value.

Examples:

tacopy SEND C:\Files\document.pdf /m 60e2f87a13d7e5074c1e05a8 /t sales@mydomain.com /i 192.168.1.1 /w

Will create a plain text message with document.pdf added as an attachment and a To Address of 'sales@mycomain.com' and send it to ThinkAutomation for processing and display the Automation return value. If no /s subject switch is supplied then the message subject will be set to the filename.

tacopy SEND /s "Subject Text" /f someone@mydomain.com /t sales@mydomain.com /b "Plain text body" /m 60e2f87a13d7e5074c1e05a8

Send a plain text message with the Subject, From Address, To Address and Body specified.

tacopy SEND C:\Emails\*.msg /m 60e2f87a13d7e5074c1e05a8

Sends all Outlook Messages (*.msg) in the folder C:\Emails to ThinkAutomation. The messages will be the full email messages including attachments.

tacopy SEND C:\Files\Body.txt /s "Subject Text" /f someone@mydomain.com /t sales@mydomain.com /m 60e2f87a13d7e5074c1e05a8

Send a plain text message using the contents of C:\Files\Body.txt as the body content.

Using TACopy On Other Computers

TACopy.exe is installed with the main ThinkAutomation Setup and the ThinkAutomation Desktop Connector setup. You can copy it to other computers if you need to send messages via the command line from networked computers.

TACopy does not require installation if you want to use it on its own.

Copy the following files from the ThinkAutomation Program Files folder:

  • TACopy.exe
  • GemBox.Email.Dll
  • Newtonsoft.Json.Dll

Copy these files into a folder of your choice. TACopy can then be executed from there. You should add the folder to the Windows Path environment variable if you want to execute TACopy from any other folder on your system.

TACopy communicates with the ThinkAutomation Server using https on port 9898.

You need to ensure that any remote IP's are added to the ThinkAutomation Whitelist in the ThinkAutomation Server Settings and ensure that port 9898 is open on the ThinkAutomation Server firewall.


Backing Up Your Settings

MetaData

All of your Solutions, Message Sources and Automations (referred to collectively as 'metadata') are stored in an encrypted document store database called 'MetaData.db' located in the settings folder:

\ProgramData\Parker Software\ThinkAutomation.NET\

You can open this folder using the ThinkAutomation Studio - File Tab - Open button next to the Data Path setting.

You can make a copy of the MetaData.db file at any time to backup your settings.

Important: The metadata file is encrypted using your ThinkAutomation system administrator user password. If you re-install ThinkAutomation on a new computer and copy an existing MetaData.db file to the settings folder - you will need to use the same password when setting up the System Administrator user - otherwise the metadata file will be inaccessible.

Server Settings

Server settings are stored in a json file called ServerSettings.json located in the settings folder. You can make a copy of this file at any time.

Library

All Custom Action settings and Automations saved to the library are stored in a document store database called Library.db also located in the settings folder.

You can make a copy of this file at any time.

Counters

If you use the Update Counter action, then any counter values are stored in a database file called counters.db also located in the settings folder.

You will need to stop the ThinkAutomation Service before making a copy of this file.

Embedded Databases

If you are using the Embedded Data Store or Embedded Files Store actions the database files will be stored in a sub-folder of settings folder called EmbeddedStore.

You can make a copy of these files at any time, however you should ensure that no Automations are executing that would update any embedded databases during the copy (or stop the ThinkAutomation service to be sure).


Backing Up The Message Store Database

How you backup your Message Store Database will depend on the Message Store Database Type (SQL Server, MySQL, PostgreSQL, MongoDB or SQLite).

If you are using the built-in SQLite database then the database file will be located in the settings folder (with a default name of ThinkAutomationMessageStore.sqlite). You can make a copy of this file when the ThinkAutomation Service is not running (copying the file when the ThinkAutomation Service is running may result in a corrupted copy).

For other database types you need to follow the database backup instructions depending on the database being used. For example, for SQL Server see: Create a Full Database Backup - SQL Server | Microsoft Docs


Examples

See: Example Automations