Get Key value
This is pre-built Action located under the @Generic Element. It instructs the Avo Assure Client to fetch the value of the specified key value from the JSON input and save the result in the given output variable.
Syntax
Input Value: <input_json>;<block_component_name>(optional);<block_component_indexes>(optional);<key_name>
Note:
Indexing starts from 1.
Traversal follows the order: Root > Parent Key > Child Key.
Ensure that the index sequence is correct and properly aligned with the JSON hierarchy.
<input_json>
(Required)
Provide the complete JSON body or input data contains the value to be fetched.
<block_component_name>
(Optional)
Specifies the hierarchical key path used to navigate from the parent key to the level before the target key. Use (.) as a separator between keys. For example: parent.child.
<block_component_indexes> (Optional)
Specifies the traversal path using indexes corresponding to each level in the JSON structure, separated by (,). For example: 1,2,1.
<key_name> (Required)
Specifies the final key from which the value needs to be extracted.
Output Value: <Dynamic Variable>;<Dynamic Variable>(Optional)
<Dynamic Variable>
(Required)
This dynamic variable stores the fetched key value from JSON body.
<Dynamic Variable>
(Optional)
This dynamic variable stores the status as True, False or None.
Example: Extracting Value from JSON Array
In this example, we explain how to extract the first_name key value from the JSON input using the Get Key Value action.
Action: Get Key Value
Input Value: <input_json>;data;1,1;first_name
The first argument (<input_json>) provides the complete JSON input that contains the value to be retrieved.
The second argument (data) specifies the parent key path used to navigate within the JSON structure.
The third argument (1,1) defines the traversal indexes used to access the correct level in the JSON structure.
The fourth argument (first_name) specifies the key whose value needs to be extracted.
Output Value: {first_name}
The extracted value (Hilma) is stored in the ({first_name}) dynamic variable.
If a second output variable is provided, the action returns the execution status as True or False or None:
True: If the value is successfully retrieved.
False or None: If the key is not found or the traversal path is incorrect.
Logical Explanation: The Get Key Value action fetches the value from the Input Value column (<input_json>;data;1,1;first_name). This action navigates through the JSON structure using the specified key path (data) and indexes (1,1). It then extracts the value of the first_name key (e.g., Hilma) and stores it in the {first_name} variable.
Traversal Explanation (Aligned with Current Example)
Traversal is performed from the parent key to the child key block using indexes.
To traverse and retrieve the value of the first_name key from the JSON structure, perform the following actions:
Start at Root
{ }.JSON begins with an object.
To move towards the array
[ ]under data, use index 1.
Navigate to Parent Key (data).
dataacts as the parent key.It contains an array
[ ].
Traverse Inside data Array.
From
{ }inside data, move into the array[ ].Select the first object
{ }> index 1.
Reach Child Key.
Inside this object, locate the key
first_name.Value present: Hilma
Traversal Path
Index Path
Key Path
Traversal is completed from:
Parent Key (data) > Child Key (first_name)
Execution Flow
Start from root object
{ }Navigate to parent key data
Select the 1st element inside the data array
Extract the value of first_name
Note:
Traversal is performed from parent key to child key block:
Use:
Component name: Used to define key path
Indexes: Used to define traversal path
Use 1 for:
First element in array
Single object

Last updated