-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKod.js
More file actions
29 lines (27 loc) · 827 Bytes
/
Kod.js
File metadata and controls
29 lines (27 loc) · 827 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
25
26
27
28
29
function doGet(req) {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheet = doc.getSheetByName("Configuration");
var range =sheet.getRange(1,1,7,10);
var values=range.getValues();
var output = [];
for (var i = 0; i < values.length; i++) {
if (i == 0) {
continue;
}
var row = {}; // Create a new row object for each row
for (var j = 0; j < 100; j++) {
if (!values[i][j]) {
break;
}
if (['URL','Port',"CICD"].includes(values[0][j])){
continue;
}
row[values[0][j]] = values[i][j];
}
output.push(row); // Push the row object to the output array
delete row;
}
var json=JSON.stringify({ data: output })
console.log(json)
return ContentService.createTextOutput(json).setMimeType(ContentService.MimeType.JSON);
}