Text - Base64 encode/decode

Declaration

<AMTEXT ACTIVITY="encryption_base64" TEXT="text" ACTION="text (options)" ENCODING="text (options)" RESULTVARIABLE="text" />

Related Topics   

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 email by way of MIME and storing complex data in XML.

Parameters

General

Property Type Required Default Markup Description
Action Text (options) Yes Encode
  • ACTION="encode"
  • ACTION="decode"
The action to perform. The available options are:
  • Encode (default) -  Encodes the target data into Base64 format.
  • Decode - Decodes Base64 encoded data into binary data.
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 (for example, %variableName%).
Encoding Text (Options) No Default
  • ENCODING="ascii"
  • ENCODING="unicode"
  • ENCODING="utf32"
  • ENCODING="utf7"
The encoding scheme to use to encode or decode the text in the Text parameter. The available options are:
  • ASCII
  • Unicode
  • UTF32
  • UTF7
  • UTF8 (default)
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

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task demonstrates Automate Desktop's ability to encode and decode data in Base64 format. A dialog will ask to enter a string of text.

Copy
<AMVARIABLE NAME="theText" />
<AMSHOWDIALOG ACTIVITY="input" DEFAULTVALUE="Enter a string of text here." RESULTVARIABLE="theText">This task demonstrates Automate's 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>