-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqueryUserDevices.gs
More file actions
24 lines (23 loc) · 858 Bytes
/
queryUserDevices.gs
File metadata and controls
24 lines (23 loc) · 858 Bytes
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 queryUserDevices(uname) {
var userinfoin = uname;
if (!userinfoin.trim()) {{var userinfo = "No user"};}
else {{var userinfo = userinfoin}
var qUser = "select B,A,C,D,E where C contains '" + userinfo + "'";
var result = Utils.gvizQuery(
"Replace with fileID of your CB_Activity spreadsheet",
qUser,
"Devices",
"A2:E"
);
}
Logger.log([userinfo, result]);
return [result];
}