Skip to content

Get Specified Value From JSON: getJsonValue

The Get Specified Value From JSON function retrieves a specific value from a JSON object. This function is particularly useful for working with structured JSON data and extracting values dynamically for automation workflows.

Example Usage: Suppose you have a JSON structure containing company details, and you need to extract the name of the first backend team member. Instead of manually searching through the JSON, you can use the Get Specified Value From JSON function to fetch the required data instantly.

scrn-sample-json-data
Sample JSON Data

To retrieve the first Backend team member’s name (“Alice”), use the key:

departments.0.teams.0.members.0.name

The dot (.) notation helps navigate the JSON hierarchy, and array indices (0-based) are used to access list elements.

Steps to Configure:

  1. Select SET from the Action dropdown.
  2. In the Element Key field, enter a variable name to store the extracted value (e.g., JsonValue).
  3. In the Parameter section, click Form and select Functions from the dropdown.
  4. Choose Get Specified Value From JSON from the list of functions.
  5. Provide the following details:
    • jsonObject: Enter the JSON content or reference a variable containing JSON data using the syntax ${Variable Name}.

Note: If you are referencing JSON data using a variable, ensure that the variable is already defined before using it in the function.

    • Key: Define the key to fetch the desired JSON value (e.g., 0.teams.0.members.0.name).
  1. Click Save.
scrn-get-json-data-tabular-view
Tabular View
scrn-get-json-data-card-view
Card View

Expected Outcome on execution:

  • The specified value from the JSON is extracted and stored in the variable defined in the Element Key.
  • The extracted data can be used dynamically in subsequent automation steps using the syntax ${Variable Name}.
  • If the JSON content is large, store it in a variable and reference it instead of entering raw data.
  • Use dot (.) notation to navigate the JSON structure.
  • Use zero-based indexing when multiple elements exist at the same level.

Back To Top