Choose where you’d like to start

toMap

Overview

The toMap function takes a JSON formatted text as an argument, and returns a key-value pair.

Return Type

  • KEY-VALUE

Syntax

<variable> = <json_text>.toMap();

where,

ParameterData typeDescription
<variable>KEY-VALUEThe variable which will contain the converted key-value pairs.
<json_text>TEXTThe JSON formatted text that needs to be converted to key-value pairs.

Note:

  • If the text is not in JSON format, a runtime error will be thrown.
  • The size of the text should be lesser than 5 MB.

Examples

 products =  "{company:Zoho, product:Creator}";
 info products.toMap(); // Returns the key-value pair {"product":"Creator","company":"Zoho"}

Get Started Now

Execute