【发布时间】:2018-08-17 06:22:13
【问题描述】:
我想从 Golang 调用 Apps Script 函数。
我可以从 Golang 发送参数,但不能使其在 runMyFunction 中工作。如果我添加return myParameter; - 我可以看到参数
我正在传递,但在 SQL 中使用它到 BigQuery 不起作用。我收到undefined
var sql = ' SELECT column1, column2 ' +
' FROM dataset.mytable WHERE SUBSTR ( column1) = "'
+ myParameter + '" ;'
我的应用程序脚本功能:
function runMyFunction(myParameter) {
...
return myParameter;
}
在 Golang 中,调用 runMyFunction
type Message struct {
myParameter string
}
m := Message{"1234"}
a := make([]interface{}, 1)
a[0] = m
req := script.ExecutionRequest{Function: "runMyFunction",
Parameters: a,
DevMode: true}
// Make the API request.
resp, err := srv.Scripts.Run(scriptID, &req).Do()
【问题讨论】:
标签: go google-apps-script google-bigquery