getJSON

This topic describes the syntax and usage of the getJSON() function in Zoho Creator

Description

The getJSON() function is used to fetch a value from a JSON object (or a string that is in the JSON format) by providing the corresponding key (which is a string).

Syntax

<string>.getJSON(<string>)

Return Value

Returns the value corresponding to the key.

Example

Fetch value from a JSON object: The getJSON() function is used to fetch the value corresponding to the key "Age" from the JSON object "var_a". Output: 15.

var_a = "{Name:James , Age:15}";
info var_a.getJSON("Age");

Fetch value from JSON-like string: The getJSON() function is used to fetch the value corresponding to the key "Name" from the JSON-like string. Output: James.

info "{Name:James , Age:15}".getJSON("Name");