this question relates to Office Script which uses TypeScript and I don't know if its an issues of my none existant coding skills or the Office Skript System.
Basically pushing 8 variables to an array works, if I add a 9. the array get's overwritten with it.
Does anybody know what I'm doing wrong?
Thanks in advance!
function main(Workbook: ExcelScript.Workbook): InterviewInvite[] {
let selectedSheet = Workbook.getWorksheet("Tabelle1");
// Convert the table rows into InterviewInvite objects for the flow.
let invites: InterviewInvite[] = [];
invites.push({
A: selectedSheet.getRange("A1").getValue().toString(),
B: selectedSheet.getRange("A2").getValue().toString(),
C: selectedSheet.getRange("A3").getValue().toString(),
D: selectedSheet.getRange("A4").getValue().toString(),
E: selectedSheet.getRange("A5").getValue().toString(),
F: selectedSheet.getRange("A6").getValue().toString(),
G: selectedSheet.getRange("A7").getValue().toString(),
H: selectedSheet.getRange("A8").getValue().toString(),
I: selectedSheet.getRange("A9").getValue().toString(),
});
console.log(JSON.stringify(invites));
return invites;
}
// The interview invite information.
interface InterviewInvite {
A: string
B: string
C: string
D: string
E: string
F: string
G: string
H: string
I: string
}