I see
here that Drop Boxes data for California data is live, but when I query the api using the following request
https://www.googleapis.com/civicinfo/v2/voterinfo?electionId=7000&address=' + address + '&key=<My Key>, it doesn't return anything for dropOffLocations[0].name, for example.
I get this error message: TypeError: Cannot read property '0' of undefined (line 23, file "Code")
Here's the code. Line 23 is the one that includes dropOffLocations[0].name
address = '3015 SACRAMENTO AVE ACTON,CA 935100';
requests.push(request)
var responses = UrlFetchApp.fetchAll(requests);
targetSheet.getRange("B2").setValue(responses.length);
for(var i=0; i<responses.length; i++) {
var response = JSON.parse(responses[i].getContentText());
targetSheet.getRange("B3").setValue(election);
var DOlocation = response.dropOffLocations[0].name;
targetSheet.getRange("B4").setValue(DOlocation);
}
Any help is appreciated