Get Data from JSON Using Key Command: SET_FROM_JSON
The Get Data from JSON Using Key command extracts a specific value from a JSON response using a defined key. This allows you to dynamically retrieve and store data for further use in automation.
Example: Suppose After making an API request, you receive the following JSON response, and you want to extract the User ID from this response:
Steps to Configure:
- Select Get Data from JSON Using Key from the Action dropdown.
- Leave the Screen Name field blank.
- In the Element Key field, enter the exact key as it appears in the JSON response (e.g., id).
- In the Parameters section, enter the variable name where the extracted value should be stored (e.g., UserID).
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Expected Outcome on Execution:
- The command extracts the value 12345 from the id key inside the user object.
- The extracted value is stored in the variable UserID.
- This variable can be referenced in later steps using ${UserID} for validation or further API requests.
Notes:
- Ensure the JSON structure is correctly formatted to match the key you are extracting.
- If the key is nested, use dot notation (e.g., user.id) to specify the path.
- Always use the exact key name as it appears in the API response (e.g., id, email, name).
- The stored value can be used in subsequent steps, such as API requests or assertions.