-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathqueryCBS.gs
24 lines (23 loc) · 835 Bytes
/
queryCBS.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// result is an array of objects if header row is specified, otherwise it is an array of arrays
//var result = Utils.gvizQuery(
// "[YOUR_SPREADSHEET_ID]",
// "[YOUR_QUERY_STRING]",
// [SHEET_ID_IF_NEEDED], // can be a number (the sheetId), or the name of the sheet; if not needed, but headers are, pass in undefined
// [RANGE], // specify range, ex: `A2:O`
// [HEADER_ROW_INDEX_IF_NEEDED] // always a number
//);
function queryCBS(sernum) {
var sernoin = sernum;
if (!sernoin.trim()) {{var sernoin = "No serial"};}
else {{var serno = sernoin}
var qUser = "select B,A,C,D,E where B contains '" + serno + "'";
var result = Utils.gvizQuery(
"Replace with fileID of your CB_Activity spreadsheet",
qUser,
"Devices",
"A2:E"
);
}
Logger.log([serno, result]);
return [result];
}