MCPcopy Create free account
hub / github.com/analyticswithadam/App_Script / pullVariables

Function pullVariables

EndtoEndAutomatedDecks.js:30–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30function pullVariables() {
31 var ss = SpreadsheetApp.getActiveSpreadsheet();
32 var sheet = ss.getSheetByName("Input");
33
34 if (!sheet) {
35 throw new Error("Sheet 'Input' not found");
36 }
37
38 var values = sheet.getRange("C5:C11").getValues().flat();
39 var validationRange = sheet.getRange("E5:E11");
40
41 var validationValues = [];
42 var validationBackgrounds = [];
43 var errorMessage = "";
44
45 for (var i = 0; i < 7; i++) {
46 if (values[i]) {
47 validationValues.push(["Valid input provided"]);
48 validationBackgrounds.push(["#b6d7a8"]); // Light green
49 } else {
50 validationValues.push(["Error: Input not provided"]);
51 validationBackgrounds.push(["#ea9999"]); // Light red
52 errorMessage += `Input Field ${i + 1} is empty. `;
53 }
54 }
55
56 validationRange.setValues(validationValues);
57 validationRange.setBackgrounds(validationBackgrounds);
58
59 if (errorMessage) {
60 throw new Error(errorMessage);
61 }
62
63 return {
64 var1: values[0],
65 var2: values[1],
66 var3: values[2],
67 var4: values[3],
68 var5: values[4],
69 var6: values[5],
70 var7: values[6]
71 };
72}
73
74
75function fetchBigQueryData() {

Callers 2

fetchBigQueryDataFunction · 0.70
formatReportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected