Google Script SetFormula转义引号

时间:2019-05-29 19:02:08

标签: google-apps-script google-sheets google-sheets-formula

我无法弄清楚单引号和双引号以及\的正确组合才能使此setFormula正常工作。

>[{ID: 3, Title: "License 1"},
{ID: 4, Title: "License 2"},
{ID: 36, Title: "License 3"},
{ID: 37, Title: "License 4"},
{ID: 38, Title: "sense 4"}]

1 个答案:

答案 0 :(得分:0)

在SQL参数内的QUERY函数文字上使用\'代替'

SpreadsheetApp.getActiveSheet().getRange('F2').setFormula('=query(arrayformula(Master!A:K), "SELECT B, C, D, E, F, G, H, I, J, K where A = \'"& \'Select Your Event\'!A3 &"\' Order By I, J",1)')