-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode.js
68 lines (56 loc) · 2.1 KB
/
Code.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const scriptProperties = PropertiesService.getScriptProperties();
const server = scriptProperties.getProperty('cred_server');
const port = parseInt(scriptProperties.getProperty('cred_port'), 10);
const dbName = scriptProperties.getProperty('cred_dbName');
const username = scriptProperties.getProperty('cred_username');
const password = scriptProperties.getProperty('cred_password');
const url = `jdbc:mysql://${server}:${port}/${dbName}`;
const apidomain = scriptProperties.getProperty('cred_apidomain');
const apiusername = scriptProperties.getProperty('cred_apiusername');
const apipassword = scriptProperties.getProperty('cred_apipassword');
function setColoursFormat(sheet,cellrange,search, colour) {
// Adds a conditional format rule to a sheet that causes all cells in range A1:B3 to turn red
// if they contain a number between 1 and 10.
let range = sheet.getRange(cellrange);
var rule = SpreadsheetApp.newConditionalFormatRule()
.whenTextContains(search)
.setBackground(colour)
// .setTextStyle(0, 5, bold)
.setRanges([range])
.build()
var rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);
}
function setWrapped(sheet,cellrange) {
var cellrange = sheet.getRange(cellrange);
cellrange.setWrap(true);
}
function setTextFormat(sheet,cellrange,search, colour) {
// Adds a conditional format rule to a sheet that causes all cells in range A1:B3 to turn red
// if they contain a number between 1 and 10.
let range = sheet.getRange(cellrange);
var rule = SpreadsheetApp.newConditionalFormatRule()
.whenTextContains(search)
// .setBackground(colour)
.setFontColor(colour)
.setRanges([range])
.build()
var rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);
}
function readData() {
var conn = Jdbc.getConnection(url, username, password);
var stmt = conn.createStatement();
readCragsData();
Volunteerdata();
readTransport();
readGear();
readTradSkills();
readSportSkills();
readSportSkillShare();
readTradSkillShare();
readGrades();
stmt.close();
}