Text - Insert

Declaration

<AMTEXT ACTIVITY="insert" TEXT="text" RESULTVARIABLE="text" 
ACTION="text (options)" POSITION="number" INSERTTEXT="text" />

Description: Inserts characters into the specified text and places the result in a variable.

Practical Usage

Used as a text manipulation tool to insert new text into an existing text value.

General Parameters

Property

Type

Required

Default

Markup

Description

Text to insert into

Text

Yes

(Empty)

TEXT="My name is Joe"

The target text to insert the new text into. As with every text parameter, if the data you wish to write is contained in a variable, simply enter the variable name surrounded by percentage signs to resolve it to it's contents at runtime (e.g., %VarName%).

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:

  • Insert at beginning: The text is inserted at the beginning of the target text.

  • Insert at end: The text is inserted at the end of the target text.

  • Insert at position: The text is inserted at a specific position of the target text.

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 the variable to receive the new value after character insertion is performed.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

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">Hello</AMVARIABLE>
<AMSHOWDIALOG MESSAGE="The value before character insertion is 
'%theTargetText%'." />
<AMTEXTINSERT ACTION="insert_end" INSERTTEXT=" World" 
TARGETTEXT="%theTargetText%" 
RESULTVARIABLE="theTargetText" />
<AMSHOWDIALOG MESSAGE="The new value after character insertion is 
'%theTargetText%'." />