[Google Apps Script] Parse a JSON string

Created on November 30, 2026

You can use JavaScript's JSON.parse() in Google Apps Script to convert a JSON string into a value. In this example, the value is an object with a name property and an age property.

function main() {
  const user = JSON.parse('{"name":"Tom","age":22}');
  console.log(user.name + " is " + user.age);
}
Tom is 22
Google Apps Script