Text - Base64 Encode/Decode
Declaration
<AMTEXT ACTIVITY="encryption_base64" TEXT="text" ACTION="text (options)" RESULTVARIABLE="text" />
Description: Encodes a sequence of binary data into Base64 format and/or decodes a sequence of Base64 encoded text into binary data.
Practical Usage
Commonly used to encode binary data that needs to be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remains intact without modification during transport. Base64 is used commonly in a number of applications including e-mail via MIME and storing complex data in XML.
General Parameters
Propery |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Text |
Text |
Yes |
(Empty) |
TEXT="text string" |
The target data to encode/decode. As with every text parameter, if the data you wish to convert 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., %variableName%). |
Action |
Text (options) |
Yes |
Encode |
|
The action to perform. The available options are:
|
Populate variable with result |
Text |
Yes |
(Empty) |
RESULTVARIABLE="VarName" |
The name of an existing variable in which to populate the newly encoded/decoded data. |
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 demonstrates ability to encode and decode data in Base64 format.
<AMVARIABLE NAME="theText" /> <AMSHOWDIALOG ACTIVITY="input" DEFAULTVALUE="Enter a string of text here." RESULTVARIABLE="theText">This task demonstrates ability to encode and decode data in Base64 format. </AMSHOWDIALOG> <AMTEXT ACTIVITY="encryption_base64" RESULTVARIABLE="theText">%theText%</AMTEXT> <AMSHOWDIALOG WINDOWTITLE="The text encoded to Base64 format.">%theText%</AMSHOWDIALOG> <AMTEXT ACTIVITY="encryption_base64" ACTION="decode" RESULTVARIABLE="theText">%theText%</AMTEXT> <AMSHOWDIALOG WINDOWTITLE="The Base64 encoded data decoded back to binary text.">%theText%</AMSHOWDIALOG>