Field extraction scripts allow you to both control how a field is extracted from the email and format the extracted data in any way you want.
The Extract Script is fired for each field after ThinkAutomation has extracted the field itself. You can then override what ThinkAutomation has extracted by setting the ThinkAutomationExtract variable inside your script to whatever value you want assigning to the field.
Whilst editing an Extracted Field click the Extract Data tab then click the Extract Script option and click the Edit button to edit the script for the selected field.
In the above example we are creating a calculated field from existing extracted fields.
You can examine previously extracted fields by using the ThinkAutomation.ExtractedFields("name").Value property. The ThinkAutomation.ExtractedFields.Count property returns the number of fields extracted. You can also change previously extracted fields by changing the .Value property.
As with other scripts you can access all the properties of the current message using the ThinkAutomationMessage object. You can use this to write a custom field extraction routines by accessing the message content using:
ThinkAutomationMessage.Body - returns the plaintext message.
ThinkAutomationMessage.HTML - returns the HTML message (if available),
ThinkAutomationMessage.MessageText - returns the raw mime text of the original message.
Click the Object Browser button to view a list of available properties, or enter 'ThinkAutomationMessage.' in the code editor to view the 'Intellisense' popup menu for the message object.
Within the code editor you can access on-line help for all basic functions. Help is context sensitive. Move your cursor to the beginning of the keyword and press F1.