Editing a Connector Profile
If you need to change the way you configured a profile, you can edit the profile in the Profile Creation wizard. If you need to make advanced edits not available in the wizard, you can edit the profile's XML directly.
Basic Profile Editing
- Select the profile in the Laserfiche Connector Configuration dialog box.
- Click Edit to open the Profile Creation wizard.
- Use the Profile Creation wizard to change the way the profile is configured. You may need to re-select applications and tokens as you progress through the wizard.
- Optional: To edit advanced options in a profile's XML directly, see Finding the XML Profile and then Editing the XML Profile.
Note: If the Profile Creation wizard doesn't recognize the profile, it will open the XML directly in Notepad. The wizard may not recognize the profile if its XML has already been edited to include advanced features not included in the wizard.
Tip: You can change the keyboard shortcut for the profile by clicking the Shortcut button in the Laserfiche Connector Configuration dialog box.
Finding the XML Profile
Advanced options that aren't available in the Profile Creation wizard, can be configured directly in the XML profile. These profiles can be accessed in the following locations:
Tip: To see where a specific profile is stored, check the Location column for the profile in the Laserfiche Connector Configuration dialog box.
- Current user: Profiles available to the current user are stored here: %APPDATA%\Laserfiche\Connector\Profiles. For example, C:\Users\John.Smith\AppData\Roaming\Laserfiche\Connector\Profiles. Note that editing a profile in this location will update the profile for that user only. To ensure updates are distributed to all Laserfiche Connector installations, configure a custom profile location.
- Custom: The custom profile location is specified in the Options dialog box opened from the Laserfiche Connector Configuration dialog box. If the custom profile location is a network or shared drive, then changes made to the profiles in this central location will automatically be available to all Laserfiche Connector installations that are pointed to this location. This configuration makes updating profiles easy as you do not have to redistribute the updated profiles to each individual machine
XML Schema file: Laserfiche Connector also comes with an XML schema file that details the different parts of the XML profiles. The XML Schema file is located here: <installation directory>\Laserfiche\LFConnector on the computer on which the Laserfiche Connector Profile Creator was installed.
Editing the XML Profile
Once you open the XML profile, you can update the following features. In Laserfiche Connector version 10.2, the schema version changed to 2.0.
<Profile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaversion="2.0">
Button Properties
From the Profile Creation wizard, you can drag the Laserfiche Connector button to a spot in a target application and you can use the button size slider to resize it. However, if you want to precisely define the button's location and size, edit the XML directly.
In the <AppDef> element, add the following attributes:
- Position and size: Create an attribute named "woffset." Give it four values, in pixels. The first value defines the distance from the right edge of the title bar, the second the distance from the top of the title bar, the third the width of the button, and the last the height of the button.
Example: This XML syntax places the Laserfiche Connector button 180 pixels left of the right edge of the title bar and 5 pixels from the top. It also gives it a width of 40 pixels and a height of 40 pixels. Additionally, users can move the button by right-clicking it and dragging it to a new position.
<AppDef woffset="-180,5,40,40" enabledrag="true" showicon="true" url="http://msn.com.*" wclass="MozillaWindowsClass" pname="firefox">
Combining Actions
You can combine two Laserfiche Connector actions in a single profile by combining elements from two separate XML profiles.
Example: You want your profile to open a website and then take a screenshot of that website. To accomplish these actions, create two profiles with the Profile Creation wizard, one that opens the website and another that takes a screenshot of that website. Open the "take screenshot" profile's XML file and locate the <AppDef> element. Copy that element to the "open website" profile and increase the value of the order attribute so that it is the last one in the <Apps> element. Then, check the following:
- Update the <FlowDef> ID to avoid errors from having duplicate flows.
- Update the manuallyrun attribute of <FlowDef> to specify if you want the action to run automatically or not.
- Clean up any duplicate steps. For example, LoadSystemTokens appears multiple times, so you can delete the duplicates.
- Check the window title, window URL, and button location.
Default Value for a Control
You can specify a default value that will be used if a control is blank when the Laserfiche Connector profile runs.
In the control's element, add the attribute "DefaultValue" and give it a value.
<StepDef type="ReadControl">
<Attributes />
<Elements>
<Element name="%(Content)">
<Attributes>
<Attribute name="Condition" value="/Root[1]/Edit[1]" />
<Attribute name="Property" value="Value" />
<Attribute name="DefaultValue" value="100" />
</Attributes>
<Children />
</Element>
</Elements>
</StepDef>
Field Types and Formatting Date and Time Tokens
By default, if there's no data type specified, Laserfiche Connector treats all the token values as strings. If you specify a data type for a token, then you can apply custom ICU formatting to the value. ICU formatting for dates and times or ICU formatting for numbers.
There are six data types you can specify as token attributes in addition to the default string type: Date, Time, DateTime, Integer, Long, and Number. These data types are case sensitive, and Laserfiche Connector will ignore data types that are not capitalized correctly.
Example: A date token returns the value "9/7/2014," but you want this to be interpreted as July 9, 2014. You can accomplish this by specifying the DateTime data type and applying this pattern: "d/M/yyyy."
Note: If you do not specify the data type first, Laserfiche Connector will ignore the pattern.
To define the data type and pattern, add the Type and Pattern attribute elements for the token, as shown below:
<StepDef type="ReadControl">
<Attributes/>
<Elements>
<Element name="%(DateTime)">
<Attributes>
<Attribute name="Condition" value="//*[@AutomationId="tbxContactFirst"]"/>
<Attribute name="Property" value="Value"/>
<Attribute name="Type" value="DateTime"/>
<Attribute name="Pattern" value="yyyy-MM-dd hh:mm:ss a"/>
</Attributes>
<Children/>
</Element>
Additionally, you can format the value of the token wherever you use the token. To apply formatting, use the syntax: %(tokenName;format).
<Attribute name="LFFolderPath" value="\Memos\%(DateTimeToken;MM_dd_yyyy)"/>
Ignoring the "Cannot Read Value of Specified Control" Error
Sometimes Laserfiche Connector may not be able to read the value of a specific control (e.g., a field or other item in the target application), causing this error to occur and interrupt Laserfiche Connector's action. You can configure the profile to always ignore this error for a specific control and to record an empty value for the control.
To ignore the error for a specific control, locate the control’s token element and set the IgnoreError attribute to true. If this option is not specified for a control, Laserfiche Connector will treat it as false and will not ignore the error.
Example:
<Element name="%(CompanyName)">
<Attributes>
<Attribute name="Condition" value="/Root[1]/Custom[1]/Custom[2]/Custom[1]/List[1]/ListItem[2]/Custom[1]/Edit[1]"/>
<Attribute name="Property" value="Value"/>
<Attribute name="IgnoreError" value="true"/>
</Attributes>
<Children></Children>
</Element>
Import Document Settings
If your profile imports a document, the following attribute values can be edited in the <StepDef type="ActionName"> element:
For importing into the currently open Laserfiche document
- Overwrite: Set this option to false to append the imported pages to the existing pages in the currently open document. If you set this option to true, the currently open document's pages will be overwritten with the imported pages.
- SaveAsNewVersion: Set this attribute to true to always save the document you imported pages into as a new version. If you set this option to false, the document will not be saved as a new version.
Note: This option only takes effect if you are importing a document whose type is on the file conversion list to be converted into Laserfiche pages. If you are importing an electronic document, the currently open document will be overwritten regardless of this attribute's setting.
Note: Documents already under version control will be saved as new versions, regardless of this attribute's setting.
<StepDef type="ImportCurrentDoc">
<Attributes>
<Attribute name="AssignTemplateMode" value="2" />
<Attribute name="NewTemplate" value="General" />
<Attribute name="RemoveOldFields" value="true" />
<Attribute name="Overwrite" value="true" />
<Attribute name="SaveAsNewVersion" value="true" />
</Attributes>
For importing into the Laserfiche Repository Windows Client
- RetainEdocFileExtension: If file extensions in electronic document names will be retained. By default, it will follow the user attribute of the user logged into the repository.
- ExtractEdocText: If text will be extracted from the imported document. By default, it will follow the user attribute of the user logged into the repository.
- GeneratePdfPages: If PDF pages will be converted to Laserfiche pages when the document is imported. By default, this attribute is set to true.
- KeepPDFFile: If the original PDF document will be kept when generating pages during import. By default, it will follow the user attribute of the user logged into the repository.
- ConvertPdfAnnotation: If PDF annotations will be converted to Laserfiche annotations when generating pages during import. By default, it will follow the user attribute of the user logged into the repository.
- PdfImportMonochrome: If PDF pages are imported in grayscale, without any color. By default, it will follow the user attribute of the user logged into the repository.
- PdfImportResolution: The resolution used when converting PDF pages to Laserfiche pages during import. By default, it will follow the user attribute of the user logged into the repository.
Example:
<StepDef type="ImportDoc">
<Attributes>
<Attribute name="LFServer" value="myserver.com" />
<Attribute name="LFPort" value="0" />
<Attribute name="LFRepository" value="MyRepo" />
<Attribute name="WindowsAuth" value="True" />
<Attribute name="UseSSL" value="True" />
<Attribute name="LFFolderPath" value="\Human Resources\Employees\%(NewEmployeeName)" />
<Attribute name="LFDocumentName" value="%(FileName)" />
<Attribute name="LFTemplate" value="Employee Info" />
<Attribute name="LFVolume" value="HumanResources" />
<Attribute name="RetainEdocFileExtension" value="true" />
<Attribute name="ExtractEdocText" value="true" />
<Attribute name="GeneratePdfPages" value="true" />
<Attribute name="KeepPDFFile" value="true" />
<Attribute name="ConvertPdfAnnotation" value="true" />
<Attribute name="PdfImportMonochrome" value="true" />
<Attribute name="PdfImportResolution" value="300" />
</Attributes>
<Elements>
Tip: The %(FilePath) token is the full path of the imported document, which you might want to save in a field. The %(FileName) token will be replaced by the document's original name. You can use this as the LFDocumentName attribute so the document keeps its name, or you could store this value in a field if you want to record the document's original name. If you define tokens with the same names as these tokens, they will still be replaced by the full path and document name (and not the values you define).
OCR Image Enhancement and Language Settings
If analyzing a window with OCR is not returning the results you want, configure the language and image enhancement settings in the XML profile to optimize OCR accuracy.
Language
By default, the OCR language is set to English, which means the OCR engine is optimized to return English words. If the windows you are OCRing are in a different language, follow the steps below to change the language.
- To change the language to Arabic, French or Spanish, click the Settings button next to OCR to extract text.
- To use a different language, do the following:
- Go to https://github.com/tesseract-ocr/tessdata
- Download the language files by clicking the Clone or download button and then selecting Download ZIP.
- Extract the files. Then copy the files pertaining to the language you want to the tessdata folder in the Laserfiche Connector's install directory. (E.g., C:\Program Files\Laserfiche\LFConnector\tessdata)
- In the XML profile, Find the <Ocr> element and change the value for the <Language> element to use the ISO 639-2 language code for the language you downloaded. E.g., Change <Language>eng</Language> to <Language>fin</Language> for Finnish.
Image Enhancements
The following is a list of some of the more useful the XML elements that can be updated to change the image enhancement settings. Image enhancements are applied during OCR to improve OCR accuracy. None of these enhancements affect the actual image.
- ImageEnhance: Turns image enhancement on or off. By default, image enhancements are turned on (value="true"). If the value is false, none of the following image enhancements will be applied.
- InvertImage: If the color of the image should be inverted. A value of 0 means no inversion will occur. This setting is useful if the image has black characters on a white background. A value of 1 means that the black and white images will be inverted. This value should be used with white characters on a black background. A value of 2 means that the OCR engine will check the background color and decide if it needs invert the image while performing OCR. By default, the value is set to 2. If OCR accuracy is poor and you know the color scheme for the pages you are OCRing, you might want to change this value to 0 or 1.
- DarkBackgroundThreshold: This option will only take effect if InvertImage has a value of 2. Assign this parameter a value between 0 and 1 that corresponds with the percentage of how dark the background is. This parameter allows for more flexibility than if you use the InvertImage parameter alone. By default, it's set to 0.5.
- ScaleImage: When OCRing a screenshot, it's strongly recommended that you scale the image to improve OCR accuracy since the initial screenshot usually has a low number of DPI (dots per inch). By default, ScaleImage is on (value="true"). To turn it off, change the value to false.
- ImageScaleFactor: If ScaleImage is turned on, this value is the factor by which the image is scaled. By default, it's set to 3.5. You may want to increase this to a value larger than 300 DPI for better OCR accuracy.
- UnsharpImage: If the image is hard to recognize, set this attribute to false to ignore the unclear portion of the image. By default, the value is true.
- UnsharpMaskHalfWidth: This enhancement can help fill in missing pixels by reducing the contrast between neighboring pixels. The value, in pixels, defines the radius of the area in which the color will be averaged. Setting the value to 20 or higher may cause more OCR mistakes. Setting this attribute to 0 is the same as setting UnsharpImage to false.
- UnsharpMaskFactor: Give this attribute a smaller value to help ignore stray marks. However, if you make the value too small, it might mistake characters like" i" or "j" as stray lines. A higher value will try to recognize all marks as characters. When there are buttons or others controls on the image, giving this attribute a value of 0.2 may increase accuracy compared to giving it a value of 0.7.
- LineRemovalOptions: This option determines if horizontal or vertical lines should be removed during OCR so that they are not mistaken for characters or numbers. A value of 0 means no lines will be removed. A value of 1 means horizontal lines will be removed. A value of 2 means vertical lines will be removed. A value of 3 means both horizontal and vertical lines will be removed. By default, the value is set to 3.
- LineHorizontalSize: This option specifies the minimum size of horizontal lines that will be removed during OCR. The default value is 30 pixels.
- LineVerticalSize: This option specifies the minimum size of vertical lines that will be removed during OCR. The default value is 30 pixels.
- NoiseWords: Noise words are words that the OCR engine might insert into the text that aren't actual words. For example, stray spots or an image on part of the page might be interpreted as the letter V, J, or l, none of which are words in and of themselves. You can list those words here (separating each word by a space), and all instances of those words will be removed from the generated text.
- WordDistance: This option specifies the maximum distance for words to be grouped as sentences or lines. The default is 12 pixels.
Recommendations
- If the image has a colorful background or characters, set LineRemovalOptions to false.
- If the image is hard to recognize, set LineRemovalOptions to false, or set ImageScaleFactor to a bigger number.
- If the image contains lots of icons, set UnsharpImage to false and LineRemovalOptions to false.
Scanning
When using the scanning action, you can configure an attribute to determine if Laserfiche Connector will wait for Laserfiche Scanning to finish.
Note: The scanning action has the following limitations:
- Regardless of how you set this attribute, Workflow starting rules that run on document creation will start the workflow before scanning has a chance to populate the document's pages. To start a workflow after scanning has populated the document, use the Entry Change event and the Document: Page Count starting condition. Learn more.
- If you close Laserfiche Scanning immediately without scanning anything, or if you scan pages but close scanning without saving, then a blank document will be created and saved, regardless of this attribute.
- Ensure you provide values for all required fields in the Laserfiche Connector profile. If the document has blank required fields, this action will fail.
- You cannot split documents in Laserfiche Scanning while using this action.
Note: This option is only available when scanning into the Laserfiche Repository Windows Client or into the currently open Laserfiche document.
- Set this option to true to wait until Laserfiche Scanning exits before finishing the profile action. If the document is blank when Laserfiche Scanning is closed, it will be deleted. Additionally, if you are scanning into the currently open Laserfiche document, the document will automatically refresh after the scanned pages have been added to it.
- Set this option to false to let the profile action finish while Laserfiche Scanning launches. The currently open Laserfiche document will not automatically refresh and blank documents will not be deleted.
Example: For the Scan into currently open Laserfiche document option:
<StepDef type="OpenDocScanning">
<Attributes>
<Attribute name="ScanMode" value="Standard" />
<Attribute name="AssignTemplateMode" value="2" />
<Attribute name="NewTemplate" value="demo" />
<Attribute name="RemoveOldFields" value="true" />
<Attribute name="WaitScanExit" value="true" />
</Attributes>
Screenshot
If you want to change how Laserfiche Connector takes a screenshot of an application or website, find the <StepDef type="TakeScreenshot"> step and configure the following attributes.
- SeparateIntoLFPages: Set this attribute to false to save the screenshot as a single image page. By default, this attribute is set to true and screenshots longer than 2000 pixels will be split into multiple image pages. It's recommended that you keep this attribute set to true if your screenshots will be large images.
- ImageHeightOfEachPage only takes affect if the SeparateIntoLFPages attribute is set to true. Specify the height, in pixels, at which Laserfiche Connector will separate the screenshot into pages. If this parameter is not set, Laserfiche Connector will separate images over 2000 pixels into separate pages. The pages' lengths will be averaged to produce pages of equal length, not exceeding 2000 pixels.
- CaptureInterval controls the rate at which images are scrolled when taking a screenshot. By default, it will scroll at a rate of 200 ms. If screenshots seem to be missing portions or spliced together incorrectly, increase this value.
In the <StepDef type="ImportScreenshot"> step, you can configure how the screenshot is imported and some broad import settings. More specific import settings are inherited from other import elements in the profile. See the Import Document Settings section below for more options for configuring imported documents.
Example: The Accounting Department needs a screenshot of the center column of their account tracking website whenever they edit a billing statement in the Laserfiche Repository Windows Client. The profile below lets them capture the center column of the website, even if it extends past the initially visible portion of the page. The resulting screenshot will be saved in the document currently open in the Laserfiche Repository Windows Client (i.e., the billing statement they are editing). If the screenshot extends beyond 2050 pixels in length, it will be split into multiple pages. The document's original template is retained and the current date is added to the Date field.
<StepDef type="TakeScreenshot">
<Attributes>
<Attribute name="CaptureMode" value="ScrollRegion" />
<Attribute name="ImageHeightOfEachPage" value="2050" />
<Attribute name="SeparateIntoLFPages" value="true" />
<Attribute name="CaptureInterval" value="200" />
</Attributes>
<Elements />
</StepDef>
<StepDef type="ImportScreenshot">
<Attributes>
<Attribute name="AssignTemplateMode" value="0" />
<Attribute name="TakeAction" value="ImportCurrentDoc" />
<Attribute name="Overwrite" value="false" />
<Attribute name="SaveAsNewVersion" value="true" />
</Attributes>
<Elements>
<Element name="LFFieldMapping">
<Attributes>
<Attribute name="LFField" value="Date" />
<Attribute name="LFValue" value="%(Date)" />
<Attribute name="AssignFieldMode" value="1" />
</Attributes>
<Children />
</Element>
</Elements>
</StepDef>
Note: The ImportScreenshot step must be after any ReadControl steps in the profile so that ImportScreenshot can make use of tokens defined in the ReadControl step. Additionally, if you are retrieving values from multiple applications, the TakeScreenshot step will reference the initial target application, by default. However, you can reference a different application by moving the <StepDef type="TakeScreenshot"> into the appropriate <AppDef> element. The ImportScreenshot step can use tokens from any previous applications configured in the profile.
Search Automatically and Show the Search Count
If you've configured Laserfiche Connector to automatically run a search and display the search count next to the Laserfiche Connector button, you can configure the timeout period after which the search will be canceled if it hasn't yet completed.
- timeout: If the auto-run search takes longer than the timeout period specified in this attribute (in milliseconds), an error occurs and the search will be canceled. This attribute only takes effect when the search is configured to automatically run in the background and display a search count, either in the Laserfiche Repository Windows Client or Laserfiche Repository Web Client. If this attribute is not set, then the search will never timeout.
<Flows>
<FlowDef id="6777c3e1-bee1-44cf-bc68-f1d1314e3938" name="Search the Laserfiche Windows client" preferweb="true" background="true">
....
<StepDef type="OpenLFClient">
<Attributes>
<Attribute name="LFServer" value="localhost" />
<Attribute name="LFPort" value="0" />
<Attribute name="LFRepository" value="MyRepo" />
<Attribute name="WindowsAuth" value="false" />
<Attribute name="LFQuery" value="({LF:Basic~="%(Edit)",option="DFNA"}) & {LF:Name="*", Type="D"}" />
<Attribute name="Timeout" value="10000" />
</Attributes>
<Elements />
</StepDef>
Search Display Options
When you've configured Laserfiche Connector to run a search in the Laserfiche Repository Windows Client, you can configure the following options:
- OpenIfOneResult: Set this option to true to open an entry if it's the only search result (instead of showing the Search Results Pane with only one item in the list). If this option is not specified, it will be treated as true.
- ShowInNewWindow: Set this option to true to show the search results in a new window. If this option is not specified, it will be treated as false, and will not open search results in a new window.
- ShowSearchPane: Set this option to true to show the Search Pane after opening the Laserfiche Repository Windows Client. If this option is not specified, it will be treated as false, and the Search Pane will not be opened.
<StepDef type="OpenLFClient">
<Attributes>
<Attribute name="LFServer" value="localhost"/>
<Attribute name="LFPort" value="0"/>
<Attribute name="LFRepository" value="MyRepository"/>
<Attribute name="WindowsAuth" value="False"/>
<Attribute name="LFQuery" value="{LF:Basic~="%(Edit)",option="DFNA"}"/>
<Attribute name="ShowInNewWindow" value="true"/>
<Attribute name="OpenIfOneResult" value="false"/>
<Attribute name="ShowSearchPane" value="true"/>
</Attributes>
<Elements/>
</StepDef>
Targeting Dynamic Controls with UI automation
If you're using UI automation to select controls in an application or website, it can be hard to select controls that only show when certain conditions are met. (E.g., The "Overdue Cases" field only appears on the website when there are overdue cases.) To gather information from controls that are not always available, edit the XML to locate the controls based on stable attributes such as the control's name.
Find a control's name
- Enable tracing.
- Right-click the Laserfiche Connectoricon in the notification section of the taskbar, and select About Laserfiche Connector.
- Click Tracing.
- Select Enable tracing and specify where the logs will be saved.
- Restart Laserfiche Connector.
- Create a new profile, and select Use UI Automation to find controls as the method of analyzing the window or website.
- Drag the target to the target window or website.
- Click Next to analyze the window or website.
- Check the trace log, located here by default: %AppData%\Roaming\Laserfiche\Connector\logs. Open the XML file named LFControlInformation_xxxxxx. In the XML file, find the control you want to get the name for. It should be a XML node like the following:
<DataItem Digest="Account Name" Name="" Id="42,7148524,2,179">
<Edit AutomationId="acc2" Digest="Account Name" Name="Account Name" VV="" Id="42,7148524,2,20" />
</DataItem>
Update the XML with the control's name
- After the profile has been created, open its XML file.
- Find the element for the token associated with the control.
- Edit the Condition attribute with XPath so that it points to the control's name instead of to a relative path.
Example:
Change
<Attribute name="Condition" value="/Root[1]/Pane[1]/Window[1]/Pane[1]/Tree[1]" />
to
<Attribute name="Condition" value="//Edit[@Name='ControlName']" />
Fields for the Assign Templates and Fields Action
The Assign Templates and Fields action allows for a lot of flexibility in how templates and fields are applied. The following XML attributes govern how multi-value fields will be handled:
Field attributes
- LFField and LFValue: If the field is a multi-value field, copy the field's LFFieldMapping element once for each value.
- AssignFieldsMode: This attribute lets you specify if the field values applied to multi-value fields will replace existing values (value="0"), be appended to existing values (value="1"), or clear all values (value="2").
Example: The following XML removes the current template but keeps the fields from the template. For the Contacts multi-value field, existing values are replaced with values gathered from the third-party application.
<StepDef type="AssignField">
<Attributes>
<Attribute name="LFServer" value="myserver.com" />
<Attribute name="LFPort" value="0" />
<Attribute name="LFRepository" value="MyRepo" />
<Attribute name="WindowsAuth" value="True" />
<Attribute name="LFQuery" value="{LF:Basic~="%(search)",option="DFNALT"}" />
<Attribute name="AssignTemplateMode" value="1" />
<Attribute name="RemoveOldFields" value="false" />
</Attributes>
<Elements>
<Element name="LFFieldMapping">
<Attributes>
<Attribute name="LFField" value="Contacts" />
<Attribute name="LFValue" value="%(FirstContacts)" />
<Attribute name="AssignFieldMode" value="0" />
</Attributes>
<Children />
</Element>
<Element name="LFFieldMapping">
<Attributes>
<Attribute name="LFField" value="Contacts" />
<Attribute name="LFValue" value="%(SecondContacts)" />
<Attribute name="AssignFieldMode" value="0" />
</Attributes>
<Children />
</Element>
</Elements>
</StepDef>
Token String Functions
Laserfiche Connector provides the string functions SPLIT, SUBSTRING, and TRIM to let you modify token strings.
Each function can be defined in a <Child> element in the XML file. To use a combination of these functions, you can add multiple Child elements for a single token <Element> element. Functions will run in the order in which they appear in the XML.
Example: With the following XML, you can split a string at a space (delimiter " "), save it as an array, and then return the second string in this array.
<Element name="%(Name)">
<Attributes>
<Attribute name="Condition" value="//*[@AutomationId="1001"]"/>
<Attribute name="Property" value="Label"/>
</Attributes>
<Children>
<Child name="SPLIT">
<Attributes>
<Attribute name="Delimiters" value=" "/>
<Attribute name="IndexToReturn" value="2"/>
</Attributes>
</Child>
</Children>
</Element>
Example: With the following XML, you can get a sub-string that starts with the string's second character and continues for a length of 10 characters.
<Element name="%(Name)">
<Attributes>
<Attribute name="Condition" value="//*[@AutomationId="1001"]"/>
<Attribute name="Property" value="Label"/>
</Attributes>
<Children>
<Child name="SUBSTRING">
<Attributes>
<Attribute name="Start" value="2"/>
<Attribute name="Length" value="10"/>
</Attributes>
</Child>
</Children>
</Element>
Example: In the following XML, the TRIM function removes leading and/or trailing white spaces from a string.
<Element name="%(Name)">
<Attributes>
<Attribute name="Condition" value="//*[@AutomationId="1001"]"/>
<Attribute name="Property" value="Label"/>
</Attributes>
<Children>
<Child name="TRIM">
</Child>
</Children>