Available Functions
Functions are used by eReceipts to format file names and data when transactions are archived so that file names and data satisfy imaging system requirements. Functions are case sensitive. Spaces between parameters are not evaluated. Assign custom functions to imaging index fields from the Imaging Indexes page. Refer to Imaging Indexes for more information about imaging indexes and applying custom functions.

Format the index line based on the ASCII character code where charCode is the ASCII character code.
CharFromCode(charCode)
charcode - ASCII character code.
Example
%CharFromCode('9') - Adds a tab to the index line. The ASCII character code 9 is a tab.

Change the order of the strings so that input1 and input2 are separated by input3.
Concatenation(input1, input2, input3)
input1, input2, input3 - input3 separates input1 and input2.
Example
%Concatenation('John', '1234', '-') - Returns John-1234

Supply a formatted string from an index value.
FormatDate({dateIndex}, 'format')
{dateIndex} - The date index that needs to be formatted.
'format' - The format that the date should be converted to.
Examples
%FormatDate({currentDate}, 'MM/dd/yy') - Returns 06/07/16
%FormatDate({currentDate}, 'MMM d yyyy') - Returns Jun 7 2016
For more information on custom date and time format strings, refer to https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings?redirectedfrom=MSDN.

Return a fraction of a second. When transactions are archived, the ability to use a fraction of a second allows the generated file name (based on index fields and custom functions) to be unique. As a result, transactions are not flagged as duplicates.
GetCurrentDateTime('format')
('format') - The seconds fraction. The minimum value is hundredths of a second ('ff') and the maximum value is ten millionths of a second ('fffffff').
Example
In this example, the GetCurrentDateTime function is configured to return milliseconds ('fff').
When:
- Member Number = 12345
- Date (May 18, 2022) = 051822
- Time (10:45:00 AM) = 104500
- GetCurrentDateTime('fff') = 999
And this is the Archive File Name format:
{MemberNumber}_%FormatDate({Date},'MMddyy')_{Time}%GetCurrentDateTime('fff').pdf
Then, this is the archived PDF file name:
12345_051822_104500999.pdf

Return the character length of the supplied string.
Len(String)
String - Any valid string expression or variable name. If the expression is of type ‘Object’, the Len function returns the size as it will be written to the file by the FilePut function.
Return Value - Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Example
var value = Hello World.
%Len(value) - Return length of the value. In this case, the length of 12 is returned.

Pad to the left of the index value.
PadLeft({index}, 'totalLength', 'paddingCharacter')
{index} - The index value that needs to be padded.
'totalLength' - The total length that the index value needs to be. Must be a whole number.
'paddingCharacter' - The character added to the right of the index value until the specified 'totalLength' is achieved. Must be a single character.
Examples
%PadLeft({index}, '8', '0')
If the index value is 123456, the new value will be 00123456.
If the index value is 12345678, the new value will be 12345678.

Pad to the right of the index value.
PadRight({index}, 'totalLength', 'paddingCharacter')
{index} - The index value that needs to be padded.
'totalLength' - The total length that the index value needs to be. Must be a whole number.
'paddingCharacter' - The character added to the right of the index value until the specified 'totalLength' is achieved. Must be a single character.
Examples
%PadRight({index}, '5', 'A')
If the index value is 12, the new value will be 12AAA.
If the index value is 12345, the new value will be 12345.

Remove characters from the beginning of the index value.
RemoveLeadingCharacters({index}, 'charToRemove')
{index} - The index value that needs leading characters removed.
'charToRemove' - The character to be removed from the beginning of the value.
Example
%RemoveLeadingCharacters({index}, '0') - Removes all zero (0) characters from the beginning of the index.
If the index value is 000123456, the new value will be 123456.

Replace alphabetical characters in the index.
ReplaceAlphaCharacters({index}, 'newValue')
{index} - The index value that needs to have all alphabetical characters (A through Z) replaced.
'newValue' - The value used to replace all of the alphabetical characters.
Examples
%ReplaceAlphaCharacters({index}, '0') - Replaces all alphabetical characters in the index with a zero (0).
%ReplaceAlphaCharacters({index}, '') - The 'newValue' in this example is two single quotation marks (') with no space between them. Removes all alpha characters in the index.

Replace characters in the index.
ReplaceCharacters({index}, 'oldValue', 'newValue')
{index} - The index value that needs characters replaced.
'oldValue' - The text which needs to be replaced.
'newValue' - The value used to replace the specified text.
Examples
%ReplaceCharacters({index}, 'A', 'B') - Replaces all A characters in the index with B characters.
%ReplaceCharacters({index}, 'temp', '') - The 'newValue' in this example is two single quotation marks (') with no space between them. Removes the text temp in the index.

Replace numeric characters in the index.
ReplaceNumericCharacters({index}, 'newValue')
{index} - The index value that needs to all numeric characters (0 through 9) replaced.
'newValue' - The value used to replace all of the numeric characters.
Examples
%ReplaceNumericCharacters({index}, 'A') - Replaces all numeric characters in the index with an A.
%ReplaceNumericCharacters({index}, '') - The 'newValue' in this example is two single quotation marks (') with no space between them. Removes all numeric characters in the index.

Return a specified length of characters.
Substring({index}, 'startIndex', 'length')
{index} - The index value source for the substring.
'startIndex' - The zero-based starting character position of a substring in this instance.
'length' - The number of characters in the substring.
Return Value - A string that is equivalent to the substring of length that begins at startIndex in this instance, or Empty if startIndex is equal to the length of this instance and length is zero.
Example
var value = This is a string.
%Substring({index}, '0', '4') - Return characters from a string beginning from startIndex (0) and extend up to length of 4 characters. In this example, This is a string returns This.

Remove leading and trailing space characters from the index value.
Trim({index})
{index} - The index value that needs leading and trailing space characters removed.
Example
%Trim({Customer_Number}) where %Trim({ 123456 })
If {Customer_Number} is " 123456 ", the new value will be "123456". The spaces at the beginning and end of the " 123456 " index value are removed.

Encode index values with XML characters.
XMLEncode(index)
index - The index value that needs special XML characters to be encoded
Examples
%XMLEncode({index}) -
If the index value contains an ampersand (&), replace it with '&'.
If the index value contains >, replace it with '>'.
If the index value contains <, replace it with '<'.
If the index value contains a single quotation mark ('), replace it with '"'.
If the index value contains a single apostrophe ('). replace it with '''.