|
Text - Insert |
Declaration
<AMTEXT ACTIVITY="insert" TEXT="text" RESULTVARIABLE="text" ACTION="text (options)" POSITION="number" INSERTTEXT="text" /> |
Description
Inserts a specified string of text into the beginning, end or precise position of an existing text value and populates a variable with the combined text contents.
Practical Usage
Used as a text manipulation tool to insert new text into an existing text value.
ParametersGeneral
Property |
Type |
Required |
Default |
Markup |
Description |
Text to insert into |
Text |
Yes |
(Empty) |
TEXT="My name is Joe" |
The target text in which to insert characters. As with every text parameter, if the data you wish to insert is contained in a variable, simply enter the variable name surrounded by percentage signs (i.e. %VarName%) to resolve it to its contents at runtime. |
Action to take |
Text (options) |
No |
insert_beginning |
ACTION="insert_end" |
Indicates the location in the target text in which characters should be inserted into. The available options are:
|
Position to insert text |
Number |
No |
(Empty) |
LENGTH="3" |
The position in the text to perform the insert. This parameter is available only if the Action to take parameter is set to Insert at position. |
Characters to be inserted |
Text |
Yes |
(Empty) |
INSERTTEXT="Hello" |
The characters that should be inserted. |
Populate variable with result |
Text |
Yes |
(Empty) |
RESULTVARIABLE="varname" |
The name of an existing variable to populate with the new value after character insertion is performed. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task displays a message box showing the value of a variable before and after a Text - Insert activity is used.
<AMVARIABLE NAME="theTargetText" VALUE="Hello"></AMVARIABLE>
<AMSHOWDIALOG>The value before character insertion is '%theTargetText%'.</AMSHOWDIALOG>
<AMTEXT ACTIVITY="insert" INSERTTEXT="World" TARGETTEXT="%theTargetText%" RESULTVARIABLE="theTargetText" ACTION="insert_end" />
<AMSHOWDIALOG>The new value after character insertion is '%theTargetText%'.</AMSHOWDIALOG>