Skip to main content

Text Formatter Block

The Text Formatter block provides a set of handy operations for string manipulation. All of the operations return a JSON with the result using the key value. The available options are:

Encode/Decode (Action)

Encode or decode a string using UTF-8, Hex, or Base64 encoding.
  • Input: String or variable to encode/decode
  • To Encoding: Encoding type (UTF-8, Hex, or Base64)
Example Input:
To Encoding:
Example Output:
JSON

Include

Determine whether one string can be found within another string.
  • Input: String or variable to search within
  • Text: Text or variable to search for
Example Input:
Text:
Example Output:
JSON

URL Encode/Decode

URL encode or decode a string.
  • Input: String or variable to encode/decode, usually a URL with characters in query params that need to be encoded
  • Operation: Encode or Decode
Example Input:
Operation:
Example Output:
JSON

Upper Case

Convert all characters in a string to uppercase.
  • Input: String or variable to convert
Example Input:
Example Output:
JSON

Lower Case

Convert all characters in a string to lowercase.
  • Input: String or variable to convert
Example Input:
Example Output:
JSON

Random Text Generator

Randomly generate a 22-character long text. Example Output:
JSON

Regex Fetch

Fetch data from the input using regular expressions.
  • Input: String or variable to perform regex on
  • Regular Expression: Standard regex syntax
Example Input:
Regular Expression:
Example Output:
JSON

Split

Split text into a list.
  • Input: String or variable to split
  • Delimiter: Character to split on
Example Input:
Delimiter:
Example Output:
JSON

Join

Join a list into a single line of text. Input: Pieces of data to join from the data picker Separator: Character to place between the concatenated parts Example Input:
JSON
Separator:
JSON
Example Output:
JSON

Slice from Start

Slice a string from a specified start index. Input: String or variable to slice Start Index: Index at which to start the slice Example Input:
JSON
Start Index:
JSON
Example Output:
JSON

Slice from End

Slice a specified number of characters from the end of a string. Input: String or variable to slice Number of Characters: Number of characters to remove from the end Example Input:
JSON
Number of Characters:
JSON
Example Output:
JSON

Truncate

Convert a decimal number to a whole number. Input: Decimal number or variable to truncate Example Input:
JSON
Example Output:
JSON

What’s Next

After you’ve finished using the Text Formatter block, you can explore other utility blocks provided by Alloy. These utility blocks range from encryption and decryption utilities, list operations, data transformation, and more. You can also start to build complex workflows by combining different blocks according to your business requirements.