Selects content from a source containing JSON-format.
Internally this command converts JSON to Xml, to make it possible to use the powerful XPath syntax to find and extract data.
Properties
| From | Name of the Input Data Source. The input-source can contain either a file-path, a PBinaryStream object or the name of a data-source or a .Net Stream object. A Stream object can only be specified programmatically. The format of the source must be a string or text document containing JSON. |
| To | Name of the Output Data Source. The output-source will always be a neutral Table-format. |
Parameters
| @Context |
Specifies in which context to find data in the JSON document. Examples:
Hint |
| @Filter | Filter the result of the selected data. See Command Maps & Parameters for more information. |
| @Order | Order the result of the selected data. See Command Maps & Parameters for more information. |
Map
| From | XPath to the object containing the desired value. The XPath must be relative to the root located by the @CONTEXT parameter, e.g. Example1: 'MANUFACTURER/NAME' Example2: 'PRICE[CURRENCY='USD']/AMOUNT' Combining the @CONTEXT and From will together locate the desired value. It is also possible to select several objects as follows: Example3: 'PRODUCT_DETAILS/{*}' |
| To | Name of the Header as it should be called in the Output table If unspecified, the name will be taken from the selected object containing the desired value. In above example 1 and 2 this will be NAME and AMOUNT. |
| Script | Not supported by this Command.If you need to perform any manipulation via script, do this in a following step, by passing the result to another Command such as SELECT or SELECT.UNIQUE. |
Example
Below example shows data in JSON format followed by an Action to read the data.
{
"Product": [{
"@id": "101",
"SKU": "AudiA4",
"Title": "Audi A4 Limousine",
"Manufacturer": {
"Name": "Audi"
"Country": {
"@id": "DE",
"Continent": "Europe",
"Name": "Germany"
}
},
"Price": [{
"Currency": "USD",
"Amount": "55000"
},
{
"Currency": "EUR",
"Amount": "52000"
}]
}]
}Below example of an Action to read the above data in JSON-format.
| From | To | Command |
| SELECT.JSON | ||
| Product | @Context | |
| @id | ID | |
| SKU | ||
| Manufacturer/Name | ManufacturerName | |
| Manufacturer/Country/Name | ||
| Manufacturer/Country/Continent | Continent | |
| Price[Currency='USD']/Amount | Price_USD |
Comments
0 comments
Please sign in to leave a comment.