The expression field is used to extract data from the HTTP response message.
The expression field is used to specify the path for extracting data from an HTTP response message.
JSONPath expressions specify the items within a JSON structure (which could be an object, array, or nested combination of both) that you want to access. These expressions can select elements from JSON data on specific criteria. Here's a basic overview of how JSONPath expressions are structured:
@ -8,7 +9,7 @@ JSONPath expressions specify the items within a JSON structure (which could be a
- `.`: Child operator used to select child elements. For example, $.store.book ;
- `[]`: Child operator used to select child elements. $['store']['book'] accesses the book array within a store object;
### Examples:
#### Examples
For example, if we want to extract the device name from the following message, we can use the expression below:
@ -28,7 +29,7 @@ HTTP response message:
}
```
Expression:
JSON Path Expression
`${sensorModelInfo.sensorName}`
@ -36,7 +37,7 @@ Converted data:
`AM-123`
If we want to extract all data from the message above, we can use the following expression:
For extracting all data from the message above, use:
`${data}`
@ -44,10 +45,10 @@ Converted data:
`{"temp": 12.2, "hum": 56, "status": "ok"}`
Or if we want to extract specific data (for example “temperature”), you can use the following expression:
For extracting a specific value, such as the temperature, use:
JSONPath expression uses for creating url address to send a message.
JSONPath expressions are used to construct URL addresses for sending messages.
JSONPath expressions specify the items within a JSON structure (which could be an object, array, or nested combination of both) that you want to access. These expressions can select elements from JSON data on specific criteria. Here's a basic overview of how JSONPath expressions are structured:
JSONPath expressions specify items within a JSON structure (objects, arrays, or a nested combination) that you wish to access. These expressions can select elements from JSON data on specific criteria. Here's a basic overview of how JSONPath expressions are structured:
- `$`: The root element of the JSON document;
- `.`: Child operator used to select child elements. For example, $.store.book ;
- `[]`: Child operator used to select child elements. $['store']['book'] accesses the book array within a store object;
### Examples:
#### Examples
For example, if we want to extract the device name from the following message, we can use the expression below:
@ -28,7 +29,7 @@ HTTP response message:
}
```
Expression:
Url Expression:
`${sensorModelInfo.sensorName}`
@ -36,7 +37,7 @@ Converted data:
`AM-123`
If we want to extract all data from the message above, we can use the following expression:
For extracting all data from the message above, use:
`${data}`
@ -44,10 +45,10 @@ Converted data:
`{"temp": 12.2, "hum": 56, "status": "ok"}`
Or if we want to extract specific data (for example “temperature”), you can use the following expression:
For extracting specific data (e.g., "temperature"), use: