General Actions
The General Actions provide a wide range of core workflow functions used throughout your Automations. These actions enable you to manipulate text, dates, files, lists, and variables; generate passcodes or hashes; encrypt, compress, or sign files; read and write documents; and manage message store records and logging. They form the building blocks for data transformation, conditional logic, system integration, and workflow control, and are typically used alongside message processing, database, web, and AI actions to complete end-to-end automation tasks.
Text Operation
Perform various operations on text.
The From value can be any text or %variable% replacement or combination.
Select the Text Operation Type:
| OperationType | Details |
|---|---|
| Trim: All Whitespace | All Whitespace (replaces all tab, CR, and LF characters, with space characters, and removes extra space's so there are no occurrences of more than one space in a row). |
| Trim: Blanks | Blanks (removes all CR/LF/tab characters and trims). |
| Trim: End | Trims the last Length characters. |
| Trim: Start | Trims the first Length characters. |
| Trim: Start & End | Trims the first and last Length characters. |
| Get: Index Of | Returns the start position of Look For value in the From value (1 based). The Look for can be a regular expression or %variable% replacement. |
| Get: Left | Get the last Length characters. |
| Get: Right | Get the first Length characters. |
| Get: SubString | Get Length characters starting at Start Position. If Start Position is not a number then the value of Start Position will be searched in the From value - and the search position will be used (if found). |
| Get: Length | Returns the character length of the From value. |
| Extract: JSON Path | Get a specific Json Path value from Json text specified in the From valu |
| Extract: Regex | Get one or all matches of the Regex Pattern. |
| Extract: Summarized Text | Extracts the most important sentences in text to build a summary. Specify the Percentage and Maximum Sentences. |
| Replace: Regex | Replace one or more Regex Pattern matches with a replace pattern. |
| Set: Format | Returns a formatted value of the From value. The Format can be any .NET format. For example: 'The delivery date is {0:d}' would return 'The delivery date is 1/1/2021' if From contained a date value. |
| Mask: Inside | Replaces Length characters starting from Start Position with * characters. |
| Mask: Profanity | Replaces all profanity words with * characters. |
| Mask: Credit Card Numbers | Replaces all Credit Card numbers with * characters. |
| Convert: To Lower Case | Returns the From value as lower case. |
| Convert: To Upper Case | Returns the From value as upper case. |
| Convert: To Word Capitalized | Returns the From value as Word Capitalized. |
| Convert: CamelCase To Words | Returns the From value as words extracted from Camel Case. Eg: customerName would return 'Customer Name' |
| Convert: HTML To Plaintext | Returns the plaintext version of any HTML text. (see: HTML Parsing Notes) |
| Convert: HTML To Plaintext (Including Tables) | Returns the plaintext version of any HTML text with more layout. Also converts any HTML tables (with thead or th elements) to text with aligned rows and columns. |
| Convert: HTML To XML | Returns the well formed XML version of any HTML text. (see: HTML Parsing Notes) |
| Convert: HTML To Json | Converts HTML to XML and then converts the XML to Json. (see: HTML Parsing Notes) |
| Convert: HTML To Markdown | Converts HTML to Markdown. |
| Convert: Markdown To HTML | Converts Markdown to HTML. |
| Convert: CSV To HTML Table | Converts CSV text into a HTML table. |
| Convert: CSV To Markdown Table | Converts CSV text into a Markdown table. |
| Convert: CSV To Json Array | Converts CSV text into a Json array. |
| Convert: Json To CSV | Converts Json/Json Array text into CSV text with headers. |
| Convert: XML To Json | Converts XML text into Json. |
The 'Sub String' and 'Get Index Of' use 1 based index positions. 'Get Index Of' will return 0 if the Look For value is not found.
The Preview will show a preview of the operation. This is useful to check how the operation will work. The preview however will not show if the From text is a %variable% replacement (since the value will not be known until the Automation executes).
Select the variable to receive the result from the Assign To list.
HTML Conversion Notes
For the Text Operation action, when converting HTML to plain text, Markdown, JSON or XML there are a number of additional options:
- Suppress Links : If enabled then links will be removed before conversion.
- Suppress Images : If enabled then images will be removed before conversion.
- Drop Tags : You can enter a comma separated list of tags to remove from the HTML before conversion. This can be useful for removing navigation blocks and footers, if you only need the page content (eg:
<nav>and<footer>tags). Specify tag names (without enclosing<and>characters, eg:nav,footer) - Drop Tags With Class/Id Names : You can enter a comma separated list of class and/or id names. Any tags with matching class or ID names will be removed from the HTML before conversion.
Regular Expression Extract
For the Text Operation action, the Extract: Regex operation allows you to extract data from the From entry based on a regular expression in the Regex Pattern entry. If All Matches is enabled then all matches are returned (one per line).
For example if the From text is set to:
Product Code Quantity
------------ --------
A1234 1
And the Regex Pattern is set to ''A[0-9]{4}'' - which means any text starting with 'A' followed by 4 numbers (0-9). Then the returned text would be 'A1234'.
Regular Expression Replace
For the Text Operation action, the Replace: Regex operation allows you to search for regular expression patterns and then perform a replacement on the matches. The replace pattern can contain substitutions.
For example if the From text is set to:
Phone Number: 4075452119
And Regex Pattern is set to "(?(\d{3}))?[\s-]?(\d{3})-?(\d{4})" and the Replace With set to "($1) $2-$3". Then the returned text would be "Phone Number: (407) 545-2119".
Date Operation
Perform various operations on dates.
Select the Date Operation Type:
| Operation Type | Details |
|---|---|
| Get Date | Extract the date from any text or variable and return it to another variable in a predefined format. Enable the Convert To UTC option to convert the date to UTC. |
| Get Time | Extract just the time from any text or variable and return it to another variable in a predefined format. |
| Get Date and Time | Extract the date and time from any text or variable and return it to another variable in a predefined format. |
| Get Interval | Calculates an Interval between a From and To date and returns the value to a variable. The Interval can be Seconds, Minutes, Hours, Days, Weeks, Months or Years. The interval can be returned as a number or duration text. Select from the Interval Format option. If Short Duration is selected then for interval will be returned as hh |
| Add To | Adds an interval Value to an existing date/time extracted from any text or variable and returns the new date time to a variable in a predefined format. |
| Subtract From | Subtracts an interval Value to an existing date/time extracted from any text or variable and returns the new date time to a variable in a predefined format. |
| Get Date and Time From Unix Timestamp | Get the date and time from a Unix timestamp. A Unix timestamp is a number representing the number of seconds since 1st Jan 1970. |
| Get Unix Timestamp From Date and Time. | Gets the Unix timestamp from a date. |
| Get Year, Month, Day, Hour, Minute, Second | Get a specific date part from any date/time. |
Select the variable to receive the result from the Assign To Variable list.
When extracting and formatting dates you can select the Locale. This will default to the system locale.
Formatting
You can use this action to change the format of an existing date %variable% or extract a specific part of a datetime and assign it to a different variable. For the Format entry you can select one of the pre-defined formats, or type a specific format string.
Use the Get Date and Time operation. Set the From to the variable containing the date. Enter or select the required Format. Select the same variable from the Assign To Variable list if you want to update the existing variable.
See: Custom date and time format strings | Microsoft Docs for available Format strings.
File Operation
Create new folders, copy, move, rename, check exists, delete files and get file information.
Use this Action to create new folders or to copy, move, check if files exists, rename & delete files and get file information. You can also use this action to generate an SHA256 hash (checksum) for any file.
Select the Operation Type:
- Create Folder
- Copy File
- Move File
- Delete File
- Rename File
- Check If File/Folder Exists
- Get SHA256 Hash For File
- Get File Size
- Get File Date
- Get File Version
- Read File To Base64 String
- Write Binary File From Base64 String
- Append To Filename
- Prefix Filename
- Get Folder Contents
Depending on the Operation Type enter the Folder, File Name, To Folder & To File Name.
You can assign the result to a variable. Select from the Assign To Variable list. The variable will be set to the new folder and file name depending on the Operation Type. For example, for the Create Folder operation the variable will be assigned to the new folder name. For the Copy operation the variable will be assigned the full path & file name of the new file. If the operation fails the variable will be assigned a blank string and the error will be shown in the log. The Check If File/Folder Exists operation will return the file/folder path is the file/folder exists, otherwise blank.
The Append To Filename and Prefix Filename operations allow you to append text or prefix text to existing file names. For example: If the Append Text is set to 'abc' and the processed filename was 'order.pdf' then the existing file will be renamed to 'orderabc.pdf'.
The Copy, Move, Delete, Append To Filename & Prefix Filename operations allow the File Name to contain wildcards. If using wildcards enable the Match Files Using Wildcards option. The File Name can contain * and ? wildcard characters. When using wildcards, if multiple files are processed then the Assign To Variable will contain a list of files processed separated by commas.
For the Copy operation you can specify the To File Name (when not using wildcards). You can specify a different destination file name. If this entry is blank the original file name will be used.
For the Copy operation you can enable the Overwrite Existing option if you want existing files in the destination folder to be overwritten. If this option is not enabled and an existing file already exists then an error will raised.
The Get File Version operation returns file information in the following format:
File: D:\ThinkAutomation\Setup Files\ThinkAutomation.exe
InternalName: ThinkAutomation
OriginalFilename: ThinkAutomation.exe
FileVersion: 5.0.240.2
FileDescription: ThinkAutomation Installer
Product: ThinkAutomation
ProductVersion: 5.0.240.2
Debug: True
Patched: False
PreRelease: False
PrivateBuild: False
SpecialBuild: False
Language: English (United Kingdom)
For the Create Folder operation the complete folder structure will be created if any levels do not exist. If the full folder already exists the Assign to variable will be assigned the existing folder name and no error will be reported. An error will only be reported for the Create Folder operation if the creation of a new folder fails.
The Get Folder Contents operation returns a list of files in the specified Folder and Mask. Enable the Include Sub-Folders option to include sub-folders. The Mask is optional, but can be used to restrict to certain file types. Specify a comma-separated list of masks (eg: .pdf, .docx).
The file list will be assigned to the Assign To variable. You can select the format of the list from the Return As list:
- Comma separated : Each path will be separated by a comma. You can use the For Each.. Comma Separated Value In action to loop through the list.
- One Path Per Line : Each path will be on a new line. Use the For Each.. Line In action to loop through the list.
- JSON : A Json array in the following format:
[
{
"Path": "D:\\Setup Files\\ThinkAutomation.exe",
"Name": "ThinkAutomation.exe",
"Extension": "exe",
"Size": 167815264,
"Created": "2020-11-20 14:58:02",
"Modified": "2020-11-20 14:58:05"
},
{..},
{..}
]
See: Changing The User Context, if you are accessing folder/files on your network.
List Operation
Create and update a list. This action enables you to create a generic list of values. You can then add to the list, delete, sort & search. You can then read single values or all values further in your Automation. Any number of separate lists can be created - with each list referenced by its name.
Each list must be given a Name. You cannot use the name of an existing %variable% as a list name. If you want to update the same list further in your Automation you would use the same name. Lists can contain any number of items (based on available memory).
Select the List Operation:
Create
Create a new list. A list must be created before any other operations can be used. If you re-create an existing list all existing items will be removed.
Specify the Of Type - this can be text, number or date. The Of Type setting determines how the list is sorted if you use the Sort operation.
Enable the Unique option to only allow unique values to be added to the list. If Unique is enabled then duplicate values cannot be added (an error will not be raised when duplicate values are added).
You can optionally initialize the created list with one or more Values. Values can contain %variables%.
You can also optionally add values contained in the Load From entry. A value will be added for each line contained in the %variable% specified.
Append
Append one or more values to the end of an existing list. Enter one or more Values to append. Values can contain %variables%.
Insert
Insert one or more values to an existing list. Specify the Index position where you want the values to be inserted. Index positions start at 1. If no index value is specified then the values will be inserted at the start of the list. The Index value can be a %variable%.
Delete
Delete a value at the specified Index position (starting at 1).
Get Value
Get a value at the specified Index position (starting at 1). The item value can be assigned to a %variable% from the Assign To list.
Get All Values
Get all values in the list and assign to the Assign To variable. The Return As defines how the list will be returned to the Assign To variable:
- Text : The list is returned as text with each value on a separate line.
- Json Array : The list is returned as a Json array.
- Markdown Table : The list is returned as a Markdown table.
- CSV : The list is returned as a CSV line with values separated by commas and quoted if required.
- HTML List : The list will be returned as a HTML unordered or ordered list.
Sort Ascending
Sort the list in ascending order.
Sort Descending
Sort the list in descending order.
Search For
Searches the list for a matching value (case insensitive) and assigns the index number to the Assign To variable (or blank if no match was found). Enter the value to search in the Search For entry.
Individual list values can be any text of any size. If the Of Type is set to number then the expected values should be numeric. If the Of Type is set to Date then the values should be dates or date+time. The date values are stored in yyyy-mm-dd hhss format so they can be sorted.
The List Operation action has many uses. It can be used to create Json arrays. Where you add separate Json blocks or values to a list and then use the Get All operation with the Return As set to Json Array.
You can use the For Each action to loop through values in a list.
You can use a list name as a %variable% replacement. This will replace the %listname% with all values in the list (one per line).
Math
Executes mathematical formulas and returns the result to a variable.
Enter the Formula text. The formula can contain %variable% replacements.
Select the variable to receive the result from the Assign To list.
Formulas can be as simple as %Price% * %Amount% which would return the value held in %Price% multiplied by the value held in %Amount%.
Click the Validate button to check the formula.
The following mathematical operations are supported:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Modulo: %
- Exponentiation: ^
- Negation: !
Standard Functions:
| Function | Arguments | Description |
|---|---|---|
| sum | sum(A1, ..., An) | Total |
| roundup | roundup(A1,Digits) | Rounds up decimal to specified digits |
| sin | sin(A1) | Sine |
| cos | cos(A1) | Cosine |
| asin | asin(A1) | Arcsine |
| acos | acos(A1) | Arccosine |
| tan | tan(A1) | Tangent |
| cot | cot(A1) | Cotangent |
| atan | atan(A1) | Arctangent |
| acot | acot(A1) | Arccotangent |
| loge | loge(A1) | Natural Logarithm |
| log10 | log10(A1) | Common Logarithm |
| logn | logn(A1, A2) | Logarithm |
| sqrt | sqrt(A1) | Square Root |
| if | if(A1, A2, A3) | If Function |
| max | max(A1, ..., An) | Maximum |
| min | min(A1, ..., An) | Minimum |
| avg | avg(A1, ..., An) | Average |
| median | median(A1, ..., An) | Median |
| round | round(A1) | Round |
| random | random() | Random |
For more complex calculations you can use the Execute Script or Create Spreadsheet action. The Create Spreadsheet action allows you to assign %variables% to cells and then read-back cell values to %variables% after all formulas have been re-calculated.
Encryption
Encrypts or Decrypts text or files using AES encryption and returns the encrypted/decrypted text/filename to a variable.
This action is used both to encrypt and decrypt text or files. Select the Encrypt or Decrypt options.
Encrypting
To encrypt text select the Encrypt option and enter the text or file to encrypt.
When encrypting text you must specify the Encoding method to use. This can be hex, base64 or URL. The default is base64.
To encrypt a file select the Encrypt File tab and select the File Path & File Name. Select the Save To Path to save the encrypted file to. Optionally enter a Save To Filename. If no filename is specified then the original file name will be used but with an '.aes' extension. You can use %variable% replacements for the file path & names - this enables you to use it with the For..Each action if you wanted to encrypt attachments.
You must specify a Key Length and Secret Key. The key length can be 256, 192 or 128. These are bit sizes. The secret key length must be 32 characters for 256 bit keys, 24 characters for 192 bit keys or 16 characters for 128 bit keys. You can use %variable% replacements for the secret key - however this must convert to the correct key length when the message is processed.
The encrypted text/file path can be returned to a variable. Select from the Assign Encrypted File To list.
Decrypting
To decrypt text select the Decrypt option and enter the text or file to decrypt. The text must be encoded using the same encoding method used to encrypt (base64, hex or URL). You must also specify the Encoding method.
To decrypt a file select the Decrypt File tab and select the File Path & File Name. Select the Save To Folder to save the decrypted file to and enter the Save To File Name.
You must specify a Key Length and Secret Key. The key length can be 256, 192 or 128. These are bit sizes. The secret key length must be 32 characters for 256 bit keys, 24 characters for 192 bit keys or 16 characters for 128 bit keys. You can use %variable% replacements for the secret key - however this must convert to the correct key length when the message is processed.
The decrypted text/file path can be returned to a variable. Select from the Assign Decrypted File To list.
Compression
Creates Zip compatible compressed archive files for attachments or files/folders. Can also be used to unzip files.
This action is used both to zip and unzip files.
Compressing Files/Attachments
To create a Zip file select Compress.
Select the Zip File Path to save the Zip file to and enter the Zip File Name. You can use %variable% replacements here. If a %variable% replacement is used for the Zip File Name (for example %msg_subject%) it will first be converted into a valid file name. If no extension exists then .zip will be used.
Enable Create New if you want a new zip file creating. If this option is not selected and an existing Zip file already exists then the new files will be added to it.
Optionally specify a Password if you want to password protect the Zip file.
Enable the Zip Attachments option if you want to compress files attached to the incoming message. You can specify a File Mask if you want to only compress files of a certain type (eg: *.pdf).
Select the local Folder and File Mask for other files you want to add to the Zip file.
The File Mask entry can contain multiple masks, separated by commas (eg: *.pdf, ThisDoc.docx, *.xlsx).
The Exclusions entry can contain filenames and masks that you want to exclude from the zip file. Separate multiple with commas.
Enable the Delete Zip After Message Is Processed option if you want ThinkAutomation to delete the Zip file after the Automation has finished executing actions for the current message. This is useful if you are creating a Zip file to send with an outgoing message and the Zip file is not needed to be kept afterward's.
Select the variable that you want the Zip file path to be assigned to from the Assign To list. You can then use this on further actions - for example on the Attach entry of outgoing messages.
Decompressing
To unzip and existing Zip file select Decompress.
Select the Zip File Path and Zip File Name.
Specify a Password if the Zip file is password protected.
Enter a File Mask for the files you want unzipped - or specify *.* for all files.
The Exclusions entry can contain filenames and masks that you want to exclude from being unzipped. Separate multiple with commas.
Select the Unzip To Folder for the folder where you want the unzipped files placed.
Enable the Delete Unzipped Files After Message Is Processed option if you want ThinkAutomation to delete the unzipped files after the Automation has finished processing actions for the current message.
The unzipped files list can be returned to a variable. Select the variable from the Assign Unzipped Files To list. This will be a comma separated list of files with their full path.
Code Sign
The Code Sign automation action can be used to add digital signatures to executable files. It can also be used to verify or remove digital signatures on existing executable files.
Select the Code Sign Operation:
1. Sign
In the EXE or DLL File entry, enter or select the file. This must be an EXE or DLL files. Multiple file paths can be separated by commas. Wildcards can be used, for example: D:\Setups\ThinkAutomation*.exe, D:\Setups\ThinkAutomation*.dll. You can use %variable% replacements.
From the Load Certificate From list, select one of:
- PFX File - you must then select the PFX File path and enter the PFX Password.
- Local Store - you must then enter the Certificate Common Name. The local certificate store will be searched for the first certificate with the matching common name.
- USB Token/Smart Card - you must then specify the USB Token Pin. This will be the password used to unlock the USB token. Enter the Certificate Common Name. The first certificate on the USB token that matches the name will then be used.
Click the Verify Certificate to verify that the selected certificate can be used.
Note: PFX and USB token passwords are stored encrypted in the ThinkAutomation settings (as are all settings).
Optionally specify a Timestamp URL. This defaults to http://timestamp.digicert.com.
Select a variable to receive the result from the Assign To list.
When the automation executes, if the file is signed successfully the assign to variable will receive the full path of the signed file (or comma separated list if multiple files are signed in a single operation).
2. Verify
This operation verifies if an EXE or DLL is already signed.
In the EXE or DLL File entry, enter or select the file. This must be an EXE or DLL files. Multiple file paths can be separated by commas. Wildcards can be used, for example: D:\Setups\ThinkAutomation*.exe, D:\Setups\ThinkAutomation*.dll. You can use %variable% replacements.
Select a variable to receive the result from the Assign To list.
When the automation executes, if the file is signed successfully the assign to variable will receive the full path of the signed file (or comma separated list if multiple files are signed in a single operation). If the file is not signed then the assign to value will be blank.
3. Remove Signature
This operation removes a digital signature from an EXE or DLL file. The operation is the same as the Verify operation, except the signature is removed from the file.
Create Hash
Generate a hash for any text/variable.
Enter the Text To Hash and specify the Hash Algorithm.
The resulting hash can be encoded in various formats (the default is Base64).
Select the variable to assign the hash to from the Assign Hash To list.
Set Message Store Flag
Assigns a Flag to the current message.
ThinkAutomation stores a copy of each processed message in the Message Store. You can assign a Flag number to the message stored in the Message Store. When viewing the Message Store you can filter by Flag.
In the Set Incoming Message Flag Number To entry, enter the flag number to assign to the current message. You can use a %variable% replacement to conditionally set a flag value based on previous actions.
You can setup any number of Flag values using the Server Settings - Message Store Flags option.
Message Store Operation
ThinkAutomation stores a copy of each processed message in the Message Store. This action can be used to read an email 'conversation'. This action can also be used to drop the current message, to pause/resume message sources and to perform a message store search.
A conversation is a list of messages in date order (newest first), between two email addresses (either from/to or to/from) where the subject is the same (ignoring any 'FW:' or 'RE:' prefixes). ThinkAutomation maintains a 'conversationid' index in the Message Store which provides fast conversation lookup.
Select the Message Store Operation:
Get Current Conversation
This operation returns the conversation for the currently executing message.
Get Another Conversation
This operation returns the conversation between two specified email addresses with the same specified subject.
Specify the Between Email Address and And Email Address.
Specify the For Subject.
You can specify the Maximum Items and Maximum Age (Days).
The message store will be searched for all messages where the From and To addresses match either of the Between email addresses and have the same subject (any 'FW:' or 'RE:' subject prefixes will be ignored). Only messages processed within the same Solution will be searched.
In the Return As list select one of:
-
Markdown : A single markdown text string is returned containing all messages.
-
Json : A Json array in the following format:
{
"Conversation": [
{
"Id": "64918ec290ca1b3ae8d9286c",
"FromName": "Test",
"ToName": "ThinkAutomation",
"Dated": "2023-06-20T11:34:26",
"Message": "Hello",
"Attachments": ""
},
{
"Id": "64918ec290ca1b3ae8d9286d",
"FromName": "ThinkAutomation",
"ToName": "Test",
"Dated": "2023-06-20T11:56:12",
"Message": "Hi There!",
"Attachments": ""
}
]
}
- CSV : CSV text in the following format:
Id,FromName,ToName,Dated,Message,Attachments
64918ec290ca1b3ae8d9286c,Test,ThinkAutomation,2023-06-20 11:34:26,Hello,
64918ec290ca1b3ae8d9286d,ThinkAutomation,Test,2023-06-20 11:56:12,Hello There!,
- HTML: HTML text in the following format:
<div style="display:flex;flex-direction:column;">
<div style="display:flex;justify-content:flex-start;margin-bottom:5px;">
<div style="border:1px solid #dee2e6;border-radius:6px;max-width:70%;padding:5px;">
<p style="margin-top:0;margin-bottom:3px;font-size:11px;color:#595c5f;">Test @ 20/06/2023 11:34</p>
Hello
</div>
</div>
<div style="display:flex;justify-content:flex-end;margin-bottom:5px;">
<div style="border:1px solid #dee2e6;border-radius:6px;max-width:70%;padding:5px;">
<p style="margin-top:0;margin-bottom:3px;font-size:11px;color:#595c5f;">ThinkAutomation @ 20/06/2023 11:56</p>
Hello There!
</div>
</div>
</div>
Select the variable to receive the results from the Assign To list. The result will be blank if there are no messages.
You can use this action if you need to display or send a transcript of a conversation between two email addresses with the same subject.
Getting A Conversation For Web Chat Form Messages.
Enable the Is Web Chat option if you want to read messages saved via the Web Chat message source. For messages saved via a web chat message source, the 'bot' reply is saved to the Automation Return value rather than being a separate message store message. If you enable this option the Automation Return value for each message will be added as the 'reply' message.
Drop Message
This operation will flag the currently executing message to be deleted from the message store database after the Automation completes.
Drop Current Conversation
This operation will delete all previous message store messages where the from/to or to/from email addresses and subject match the currently executing message. The current message will not be deleted. The Assign To variable will receive the number of messages deleted.
Drop Another Conversation
This operation deletes all previous message store messages between two email addresses with the same subject. Specify the Between Email Address and And Email Address. Specify the For Subject. The current message will not be deleted. The Assign To variable will receive the number of messages deleted.
Pause Or Resume Message Source
This operation can be used to pause or resume any Message Source within the same Solution. Select the Message Source from the list, this must be within the same Solution as the Automation. The Pause/Resume Message Source operations can be used to conditionally pause/resume Message Sources in addition to any Schedule assigned to the Message Source.
Get Message Source Status
This operation can be used to check the status of any Message Source within the same Solution. Select the Message Source from the list, this must be within the same Solution as the Automation. Select the variable to receive the status from the Assign Status To list. The status returned will be one of: 'Active', 'Disabled', 'Paused' or 'Missing' (if the Message Source has been deleted).
Search Message Store
This operation can be used to search the Message Store for any messages within the same Solution. A list of matching messages will be returned. The search results can be returned as a HTML table, allowing you to setup a message archive search system in conjunction with a Web Form.
You can then specify one or more search values. All search values can contain %variable% replacements.
You can search any or all of the following (if multiple search values are used then ALL must match):
- Subject, From Address, To Address, Keywords Or Attachment Names Containing - specify a value to search against subject, from/to addresses or attachment names (leave blank for all). You can use space or the + operator to search for multiple terms (eg: sales+order would return items containing 'sales' AND 'order'). If a search term itself contains a + character then you should enclose it in double quotes. This parameter can be used to use a single search term for subject, keywords, from/to, attachment names.
- Subject Containing - specify a value to search against the subject (leave blank for all).
- From Address Containing - specify a value to search against the 'from' address (leave blank for all).
- To Address Containing - specify a value to search against the 'to' address (leave blank for all).
- Automation Return Value Containing - specify a value to search against the automation return value (leave blank for all).
- OR Message Ids In - specify a %variable% containing a list of Message Ids. This can be used in conjunction with the Full Text Search action in order to perform a full text search on message body text. You would update a full text search collection using the incoming email body on a separate automation.
The message store will be searched for all messages matching the above. Only messages processed within the same Solution will be searched.
You can also optionally specify the From Date and To Date. These can also be %variable% replacements. If no dates are specified then all messages are searched.
If the Distinct option is enabled, then only messages with unique From/To/Subject and size are returned.
You can specify a Message Source - if you only want to search messages received by a specific Message Source. If no Message Source is specified in the all messages within the Solution will be searched (except the Message Source of the search Automation itself).
You can specify the Maximum Items and Maximum Age (Days).
The URL returned in the results is a link to view the full message in a browser. Enable the Always Use Local Links option to return local links. If this option is not enabled then the message links will be public (served via the API Gateway).
In the Return As list select one of:
-
Markdown : A single markdown text string is returned containing all messages.
-
Json : A Json array in the following format:
{
"Items": [
{
"Id": "66de9057c937df0bf66395ae",
"From": "someone@test.com",
"To": "myname@mydomain.com",
"Dated": "2024-09-09T06:06:15",
"Importance": "N",
"Subject": "Test Message",
"Size": 6345,
"Attachments": "Document.pdf",
"ReturnValue": "test",
"Url": "https://api.thinkautomation.com/xxx/viewmessage?id=xxx"
},
{
"Id": "66de9025c937df0bf6639583",
"From": "someone@test.com",
"To": "myname@mydomain.com",
"Dated": "2024-09-09T06:05:25",
"Importance": "N",
"Subject": "Another Test Message",
"Size": 3435,
"Attachments": "",
"ReturnValue": "test",
"Url": "https://api.thinkautomation.com/xxx/viewmessage?id=xxx"
}
]
}
- CSV : CSV text in the following format:
Id,From,To,Dated,Importance,Subject,Size,Attachments,ReturnValue,Url
- HTML Table: HTML text in the following format:
<table id='taMessages'>
<thead>
<tr>
<th id='taMC1'>View</th>
<th id='taMC2'>📎</th> <!--attachment icon-->
<th id='taMC3'>From</th>
<th id='taMC4'>To</th>
<th id='taMC5'>Date</th>
<th id='taMC6'>❗</th> <!--important icon-->
<th id='taMC7'>Size</th>
<th id='taMC8'>Subject</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href='https://api.thinkautomation.com/xxx/viewmessage?id=xxx' target='_blank' rel='nofollow'>View</a></td>
<td>📎</td>
<td>from@test.com</td>
<td>to@test.com</td>
<td>09/09/2024 07:06</td>
<td></td>
<td>10.9KB</td>
<td>Test Subject/td>
</tr>
</tbody>
</table>
- HTML Table (Bootstrap) : Same as the HTML Table option but with Bootstrap styles added.
Select the variable to receive the results from the Assign To list. The result will be blank if there are no messages.
You can use this action if you need to process or display the results of a Message Store search. The Url property of the returned results is a link to view the message detail (body).
Set Logging Level
Set the logging detail level for the current message.
This action can be used to change the level of logging for the currently executing message. This is useful if you have many actions, or actions that loop and you want to reduce the number of log entries to improve performance. Setting the logging level to 'Minimal' will cause only errors to be logged.
Any Comment actions that have the Show In Log option enabled will always be logged, regardless of the current logging level.
For fast running Automations, or Automations that generate many log entries, you should use the Set Logging Level action to set the logging level to 'minimal' once you have completed debugging your Automation. This will significantly increase performance.
It can also be used to increase the logging level whilst debugging a specific Automation.
You can change the logging level multiple times during an Automation.
The logging level will revert back to the default once the Automation has completed executing actions for the current message.
You can set the default logging level for all Automations using the Server Settings - Logging option.
Create Passcode
Creates a random Passcode and assigns the value to a variable.
This action can be used to generate a random passcode. The passcode can then be sent by email (via the Wait For User Response or Send Email actions) or by SMS (via the Twilio Send SMS Message and Twilio Wait For SMS Reply actions) in order to implement two-factor authentication or to check that a given email address or mobile phone number is valid.
Select the Passcode Type. This can be:
- Letters (a-z)
- Letters & Numbers (a-z,0-9)
- Letters, Numbers & Special Characters (a-z,0-9, ~!@#$%^&*_-+=|(){}[]:;<>?/)
- Numbers Only (0-9)
- Random Word and Numbers
- Two Random Words and Numbers
Enable Include Upper Case to also include (A-Z) characters if Numbers only is not used.
Enter the Number Of Characters. This can be between 3 & 99.
Select the variable to assign the passcode to from the Assign To list.
The Passcode generated will be random containing no repeating characters. The Passcode is not guaranteed to be universally unique.
For the Random Word and Two Random Words options the passcode will consist of one or two random words (English) followed by numbers (based on the Number Of Characters entry). For example: 'Glove2085' - if the number of characters was set to 4. If the Include Upper Case option is enabled then the first character of the random word will be in upper case.
Find and Replace
Finds and replaces text in any ThinkAutomation variable and returns the result to the same or different variable.
Enter the text to find in the Replace entry. You can make use of %variable% replacements.
Enter the text to replace with in the With entry. Again you can use %variable% replacements. Note: The With value can be blank if you wish to just remove the Replace value.
In the In list - select the field to use for the replacement. This can be any of your extracted fields/variables.
By default the text search will start at the beginning of the text. Enter a Start At Character value if you want to start the search from a specific character position.
Enable Replace All Occurrences if you want all occurrences of the Replace text to be replaced.
Enable Case Sensitive Search if the find should be case sensitive.
You must then select variable to assign the replaced text to from the Assign Result To list. By default the same variable that you select in the In selection will be used.
You can also perform regular expression replacements using the Text Operation action.
Read Or Write Text File
Saves data to any text file and/or reads the contents of the file into a variable. This action can be used to save text or %variables% to a text file, or read the contents of a text file and assign the contents to a %variable%.
The File Path must contain a path & filename of the text file to write to/read from.
Writing
On the Write To File tab you can define the text that you want to write to the file. The file will be created if it does not already exist. All directories contained in the path will be created if they do not exist.
Select the file Format. This can be ASCII, Unicode or UTF-8 (default). Select the Line Terminator that will be appended to the text written to the file.
Enter the Content that you want to write to the file. This can contain %variable% replacements.
If the Append To File option is enabled then the new text will be added to the end of any existing text file. If the Make Backup option is enabled the existing file will be copied to the same file name with a .BAK file first.
On the Read From File tab you can select a ThinkAutomation variable that you want to assign the text file contents to. The file will be read again after any text is written to it.
Reading Only
Select the Read From File tab and then select the %variable% to assign the text file contents to from the Assign Content To list. You can optionally assign the total line count to a variable selected from the Assign Total Line Count To list.
You can optionally read specific lines only from the text file. In the Read From Line entry, specify the starting line number (or leave blank for the start of the file). This can be a %variable%. In the Read To Line entry, specify the end line number (or leave blank for the end of the file). This can be a %variable%. If both the Read From Line and Read To Line values are blank, then the entire file is read. When reading specific lines, the text file is not read into memory, making it suitable for large files.
If you need to read new lines from a text file, save the Assign Total Line Count value (you can use the Embedded Value Store action to persist the value between automation executions). Then on subsequent reads, set the Read From Line value to the previous line count + 1.
If nothing is specified in the Content entry then the file is only read.
Tokenize
Gets a list of comma separated tokens (words) for any text.
Enter the Text/HTML to tokenize. If the text is HTML then the HTML will be converted to plain text first.
Options:
- Remove Common Words : Remove all common words (and, the, a etc.) from the tokens list.
- Remove Email Addresses & Urls : Removes any email addresses and URLs from the tokens list.
- Include Numeric Tokens : Include tokens containing numbers and dates in the tokens list.
- Normalize : Normalizes common contractions (eg: 'what's' to 'what is') and common abbreviations (eg: hi to hello, nov to november, ur to your, bday to birthday, 2day to today, plz to please, thx to thanks etc.)
- Stem Words : Reduces words to their root form (English only). For example: the words 'ask','asking' and 'asked' would all stem to 'ask'.
- Unique : Duplicates are removed from the tokens list.
- Include Count : The frequency is appended to each token (if unique enabled).
- Sort By : None, frequency, word (if unique enabled).
- Top : Return the top x words if sorted (if unique enabled).
The tokens can be assigned to a variable. Tokens are returned as a comma separated string.
Sentence Tokenization
Enable the Tokenize Into Sentences option to return a list of sentences (one per line) instead of tokens. The text will first be tokenized and then the top x sentences will be returned in keyword density order. This can be useful when used in AI automations and the Embedded Vector Database action, to shorten large text.
Extract Address Parts
Parses a postal address block and extracts specific parts (Company Name, Address Line 1, Address Line2, State, Zip/Postcode, Country).
In the Extract Address From enter the address or a %variable% containing an address.
You can then assign Company Name, Address Line 1, Address Line 2, State, Zip/Postcode and Country to variables.
You can also assign the normalized address block to a variable from the Assign Address To list. The normalized address will include above parts, one per line. US state abbreviations will be expanded.
This action will attempt to locate the country/state using the zip/postcode if no state/country is specified in the incoming address. This currently supports UK, USA, Canada & Ireland postcodes.
Postcodes for European countries (France, Germany, Spain, Italy, Netherlands) will be extracted if the address contains the country name.
This action is useful where an address block has been extracted from a document using the Extract Field action with the Extract Using Text Range option.
You can test the address extraction by pasting an address into the Extract Address From entry and clicking the Test button.
Extract Email Signature
Parses contact and company information from email signature footers.
ThinkAutomation will parse the email text and extract the footer block. From this it attempts to extract the following:
- Name
- Known As
- Title
- Company Name
- Address
- Company Number
- VAT Number
- Phone
- Mobile Phone
- Other Phone Numbers
- Web Address
- Unsubscribe Link
- Privacy Policy Link
- Social Links
- Other Links
- Footer Text
- Pre-Signature Text (the body text before the signature part)
In the Assign Signature Info grid, select the Property name and the variable you want to assign the value to.
The complete signature block Json can also be assigned. Select from the Assign Json To list.
For example, consider the following email text:
Hi,
Please find attached the report you requested.
Kind regards,
Clare
Senior Accountant
p: +44 (0)330 0882 943 | US (800) 680 7712
e: clare.rowley@parkersoftware.com
w: https://www.parkersoftware.com
https://www.whoson.com
https://www.thinkautomation.com
This email is from Parker Software Ltd.
Victoria Business Park, Prospect Way, Knypersley, Staffordshire, ST8 7PL.
Registered in England & Wales No. 4525820.
The email signature would be extracted as:
{
"FirstName": "Clare",
"LastName": "",
"Name": "Clare",
"KnownAs": "",
"Title": "Senior Accountant",
"Company": "Parker Software Ltd",
"Address": [
"Victoria Business Park",
"Prospect Way",
"Knypersley",
"Staffordshire"
],
"State": "England",
"StateCode": "",
"PostCode": "ST8 7PL",
"Country": "United Kingdom",
"CompanyNumber": "4525820",
"VatNumber": "",
"EmailFrom": "stephen@parkersoft.co.uk",
"Email": "clare.rowley@parkersoftware.com",
"Phone": "+44 0 330 0882 943",
"MobilePhone": "",
"OtherPhoneNumbers": [
"800 680 7712"
],
"WebAddress": "https://www.parkersoftware.com",
"UnsubscribeLink": "",
"PrivacyPolicyLink": "",
"GoogleMapsLink": "",
"SocialLinks": null,
"OtherLinks": [
"https://www.parkersoftware.com",
"https://www.whoson.com",
"https://www.thinkautomation.com"
],
"Text": "Clare\r\nSenior Accountant\r\np: +44 (0)330 0882 943 | US (800) 680 7712\r\ne: clare.rowley@parkersoftware.com\r\nw: https://www.parkersoftware.com\r\nhttps://www.whoson.com\r\nhttps://www.thinkautomation.com\r\nThis email is from Parker Software Ltd.\r\nVictoria Business Park, Prospect Way, Knypersley, Staffordshire, ST8 7PL.\r\nRegistered in England and Wales No. 4525820.\r\n",
"PreSignatureText": "Hi,\r\n\r\nPlease find attached the report you requested.\r\n\r\nKind regards,\r\nClare \r\n"
}
The above Json can also be referenced directly using the %Msg_SignatureJson% built-in variable without using this action.
The amount of information extracted will depend on the email footer (if any). This action can be used on any type of email, however the accuracy will be better for non-marketing type emails. Currently only English text is supported.
Text To Speech
Uses the Windows speech synthesizer to convert text to a WAV file containing a spoken version of the text.
Enter the Text To Speak. This can contain %variable% replacements.
Select the Voice. This list will be populated by Speech language packs installed on your system. You can install more language packs in your Windows settings. After selecting a Voice, click the Test button to hear how the text will sound.
Select or enter the Save To path where the created wav file should be saved.
Enter the WAV File Name. This can contain %variable% replacements. The .wav extension will be added if necessary.
If the Ensure Unique File Name option is selected then ThinkAutomation will append a unique timestamp to the filename to ensure it is unique within the Save To path.
If Delete File After Message Is Processed is enabled then ThinkAutomation will remove the file when the Automation completes for the current message. This is useful if you wish to use the wav file in the Automation (for example, to send the file as an attachment with the Send Email action), but do not need to keep a local copy afterwards.
You can assign the saved path & filename to a variable by selecting the variable from the Assign Saved File Path To list. You can then use this variable in the Attachments entry on Send Email actions or in any other way.