Defining JSON Fields
If you define JSON fields, you make values of the selected items automatically available. Your filter definition makes such fields available for mapping to variables in actions. This allows you to extract the element values.
To define JSON fields:
-
Select your element and set its Usage to Variable value.
-
The element is displayed on the structure list with bold letters, indicating that it is in use.
-
The element is used as output field name.
-
The Data Preview section highlights the values of the selected element.
Formatting Options
This section defines string manipulation functions that apply on the selected variables or fields. You can select one or several functions. These functions are applied in the same order as selected in the user interface – from top to bottom.
- Delete spaces at the beginning: Deletes all space characters (decimal ASCII code 32) from the beginning of a string.
- Delete spaces at the end: Deletes all space characters (decimal ASCII value 32) from the end of a string.
- Delete opening and closing character: Deletes the first occurrence of the selected opening, and closing characters that are found in a string.
Example
If you use "{" for the opening character and "}" for the closing character, the input string {{selection}} converts to {selection}.
- Search and replace: Executes standard search and replace function upon the provided values for find what and replace with. You can also use regular expressions.
Note
There are several implementations of the regular expressions in use. Loftware Automation uses the .NET Framework syntax for the regular expressions. For more information, see .NET Framework Syntax for Regular Expressions.
- Replace non printable characters with spaces: Replaces all control characters in the string with space character (decimal ASCII code 32). The non printable characters are characters with decimal ASCII values between 0–31 and 127–159.
- Delete non printable characters: Deletes all control characters in the string. The non printable characters are characters with decimal ASCII values between 0–31 and 127–159.
- Decode special characters: Special characters (or control codes) are characters that are not available on the keyboard, such as Carriage Return or Line Feed. uses a notation to encode such characters in human-readable form, such as <CR> for Carriage Return and <LF> for Line Feed. For more information, see section Entering Special Characters (Control Codes).
This option converts special characters from syntax into actual binary characters.
Example
When you receive the data sequence "<CR><LF>", uses it as a as plain string of 8 characters. Enable this option to interpret and use the received data as two binary characters CR (Carriage Return - ASCII code 13) and LF (Line Feed - ASCII code 10).
- Search and delete everything before: Finds the provided string and deletes all characters from the beginning of the data until the string. The found string itself can also be deleted.
- Search and delete everything after: Finds the provided string and deletes all characters from the string until the end of the data. The found string itself can also be deleted.
- Change case: Changes all characters in your strings to uppercase or lowercase.
Data Preview
This section provides preview of the field definition. If the defined item is selected, the preview highlights its placement in the preview data.
- Preview file name: Specifies the file that contains sample data that is going to be parsed by the filter. The preview file is copied from filter definition. If you change the preview file name, the new file name is saved.
- Open: Selects another file upon which you want to execute the filter rules.
- Refresh: Re-runs the filter rules upon the contents of the preview file name. Automation updates the Data Preview section with the result.