I want to call Apps Script function from Golang.
I can send the Parameter from Golang but cannot make it work in runMyFunction. If I add return myParameter; - I can see the parameter
I am passing but using it inside SQL to BigQuery is not working. I am getting undefined
var sql = ' SELECT column1, column2 ' +
' FROM dataset.mytable WHERE SUBSTR ( column1) = "'
+ myParameter + '" ;'
My Apps Script Function:
function runMyFunction(myParameter) {
...
return myParameter;
}
In Golang, calling 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()