JSON_FIELD

Extracts a specific field from JSON data

Updated over a week ago

Description

JSON_FIELD() retrieves a particular field specified by the JSON path from a JSON object. This is helpful for accessing specific data within a JSON structure.

Syntax

JSON_FIELD(json, json_path)

Output

text

Variables

  1. json: The JSON object.

  2. json_path: The path to the specific field in the JSON object.

Example

JSON_FIELD(`Company Details`, "$.company_name")

Company Details

JSON_FIELD

{"company_id": 1, "company_name": "ABC Inc.", "revenue": 500000, "location": "New York"}

ABC Inc.

{"company_id": 2, "company_name": "XYZ Corporation", "revenue": 750000, "location": "San Francisco"}

XYZ Corporation

{"company_id": 3, "company_name": "LMN Enterprises", "revenue": 300000, "location": "Chicago"}

LMN Enterprises

Did this answer your question?