Google apps script Google应用程序脚本PropertiesService是否支持序列化数据或数组?

Google apps script Google应用程序脚本PropertiesService是否支持序列化数据或数组?,google-apps-script,Google Apps Script,我试图通过PropertiesService传递序列化数据或数组,以便在文档中构建动态表。我在想这样的事情: var properties = PropertiesService.getDocumentProperties(); var orderList = properties.getProperty("orders"); // iterate through orderList to add rows to a table with columns like description, a

我试图通过PropertiesService传递序列化数据或数组,以便在文档中构建动态表。我在想这样的事情:

var properties = PropertiesService.getDocumentProperties();
var orderList = properties.getProperty("orders");

// iterate through orderList to add rows to a table with columns like description, amount and price.
这是可能的,还是我应该回过头来处理索引和键名的字符串操作,如:

var rowCount = properties.getProperty("row_count")

// for-loop till rowCount
var itemDesc = property.getProperty("item_" + i + "_description")
var itemPrice = property.getProperty("item_" + i + "_price")

这两种方法都有效。然而,有些配额可能会限制这两种方法

如果要序列化数组并将其保存到orders属性,则必须确保它保持在每个值9kb的限制之下

如果要为每个行项目创建属性,则需要保持每天500k的读/写容量。这一数字将在不久的将来改变为灵活的配额制度


这是否与GAS具有相同的限制,即不能传递日期项,但必须首先将其转换为字符串?是的,属性值必须是可以字符串化或具有toString的值。当您说序列化数组时,您的意思是我将整个内容编码为1个JSON字符串,然后将其作为单个值传递给属性?setProperty'orders'、“{order…”;或者您的意思是可以传递一个实际数组吗?通过序列化,我的意思是JSON.stringify您的数据,然后再将其设置为属性为的值。