LoginSignup
10
9

More than 5 years have passed since last update.

Google Apps Script でjsonデータの読み込み

Posted at

Utilities.jsonParse() を使っているサンプルが多いけど、数字キーのデータが扱えないっぽいので JSON.parse() を使うほうが良さそう。

function myFunction() {
  var str = '{"1234":"hoge"}';
  Logger.log(JSON.parse(str)[1234]);
  Logger.log(Utilities.jsonParse(str)[1234]);
}

Issue 873 - google-apps-script-issues - Utilities.jsonParse does not behave like JSON.parse - Google Apps Script issues and feature requests - Google Project Hosting

10
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
9