This guide assumes familiarity with the basics of the editor (How to Use Bixby Home Studio).
In this guide, you'll learn how to use a JSON Query
node by designing an action flow for the command:
"Increase the volume of the speaker by 25%"
You must get the result of a command and give the user the information for the command executed. Sometimes the output of nodes (responses) are in JSON format. To extract information from these responses, you can use the JSON Query
node.
For example, after executing the voice command "Increase the volume of the speaker by 25%", the output (response) is shown below. You can extract the status information with a JSON Query
node.
{
"results": [
{
"id": "6a2e9434-5b19-47s0-92a8-685de69106a3",
"status": "ACCEPTED"
}
]
}
The JSON Query
node parses and extract values or objects from the JSON response, which allows you to convert the data into a usable format.
The JSON Query
node takes in the following input parameters:
You can configure the node with:
Output
Node value type can be set to Boolean, Integer, Number, Object, Duration, ColorMap, String or Vocab. The JSON Query
node outputs the following parameters:
The pointer defines the string syntax for identifying a specific value in a JSON object.
You can see an example below:
The example graph below shows the action flow of using a JSON Query
node:
{
"results": [
{
"id": "6a2e9434-5b19-47s0-92a8-685de69106a3",
"status": "ACCEPTED"
}
]
}
JSON Query
node to parse the status
property from the response JSON.status
property output by the JSON Query
node to the string "ACCEPTED"
.true
, go to a Response: Success
node; otherwise, go to a Response: Execution Failed
node.