I’m trying to export details from out app into a google sheet and am getting an “Invalid argument” error. I’m trying to take the data from the page and also grab users’ birthdays on export. We use firestore as a db.
exportStaff(shift) {
console.log(shift)
const exportHeaders = [
"Day",
"Event",
"Position",
"Start",
"End",
"First Name",
"Last Name",
"Phone",
"Email",
"Confirmed",
"DOB",
"Code",
];
const exportItems = [];
for (var key in this.orderedPlacedUsers2(shift.id)) {
function myDOB(staff) {
return fb.usersCollection.doc(staff).get()
.then(doc => {
console.log(doc.data().dob)
return doc.data().dob
})
}
exportItems.push([
shift.day,
shift.event,
shift.position.title,
shift.startTime,
shift.endTime,
this.orderedPlacedUsers2(shift.id)[key].firstName,
this.orderedPlacedUsers2(shift.id)[key].lastName,
this.orderedPlacedUsers2(shift.id)[key].phone,
this.orderedPlacedUsers2(shift.id)[key].email,
this.orderedPlacedUsers2(shift.id)[key].confirmed,
myDOB(this.orderedPlacedUsers2(shift.id)[key].userId),
`=REGEXEXTRACT(H2,"....$")`
])
}
this.$gapi.getGapiClient().then(gapi => {
const exportService = new ExportService(exportHeaders, Object.values(exportItems), gapi);
exportService.export();
});
},
All of the birthdays are logging correctly to the console, but no values show on the sheet.
Here is a screenshot of the error in the console.
How can I get the birthdays (DOB) to export properly?