如何在Google App脚本的“属性服务"中将2D数组保存到脚本属性? [英] How to save a 2D array to a Script Property in Properties Service in Google App Script?

查看:63
本文介绍了如何在Google App脚本的“属性服务"中将2D数组保存到脚本属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个2D数组,需要将其另存为Google App脚本中的属性.我该怎么做?

I have a 2D array that I need to save as a property in Google App Script. How would I do this?

var array = [['value 1', 1.0, 'A'],['value 2', 2.0, 'B'],['value 3', 3.0, 'C']]

PropertiesService.getScriptProperties().setProperty('myArray', array)

运行上面列出的代码时,我得到[Ljava.lang.Object;@40ac055f作为值.

When I run the code as listed above I get [Ljava.lang.Object;@40ac055f as the value.

当我使用array.toString()时,属性值使方括号无效.

When I us array.toString() the property value negates the square brackets.

提前谢谢!

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆