Parser
Description
Parser is used for filling the field mapping table with detected data or from a predefined list.
If a null string or binary value is detected, a single tuple is returned with a null value.
If an empty input string value is detected, a single tuple is returned with a null value.
- The parser set on CSV or JSON can flatten a parsed input into multiple tuples.
Manage JSON responses from REST calls. (See example below)
It is useful to parse data within a Flow so that data can be processed without having to send it to another location and then add it with a new Input in a new Flow.
Jump to our full documentation on using parsers in Hero Platform_.
Use
- Input field:
- Select the input field. (String or binary)
- Error handling:
- Mark the radio button for how to handle errors.
- Do default flow failure handling.
- Handle failures in this node.
- Enter a field name for the Failure and Success fields.
- The Hero Platform_ error message is displayed for tuples with an error in processing.
- A Boolean value is displayed under the Success field. The value true of the parse was successful and false if an error occurred.
- Enter a field name for the Failure and Success fields.
- Mark the radio button for how to handle errors.
- Parser:
- Select the parser type and fill the parser's configuration. (See Work with Parsers)
Click the refresh icon by the field mapping table to review the detected field names.
Example
{ "Product": { "Bikes":[ { "Brand":"Dolan", "Color":"White" }, { "Brand":"Fuji", "Color":"Red" }, { "Brand":"Look", "Color":"Black" } ] } }
Parsing a JSON using the default root path:
Parsing a JSON defining the root path:
Additional Example
EML binaries to individual email components:
MSG files are a proprietary Microsoft format. To parse the emails they can first be converted into EML format. The output are EML files in binary form. The Parser function can take the raw EML binary files and split the EML files into individual email components.