I am trying to update the title of a spreadsheet using the code shown below 
but keep getting the following error. Please help. I am not sure what I'm 
doing wrong here.

Error Domain=com.google.GTLRErrorObjectDomain Code=400 "Invalid 
requests[0]: No request set." UserInfo={GTLRStructuredError=GTLRErrorObject 
0x60c000054250: {errors:[1] message:"Invalid requests[0]: No request set." 
code:400 status:"INVALID_ARGUMENT"}, NSLocalizedDescription=Invalid 
requests[0]: No request set.}

 func updateTitle(spreadSheetID: String) {
 let batchUpdate = GTLRSheets_BatchUpdateSpreadsheetRequest()
 let request = GTLRSheets_Request()
 request.updateSpreadsheetProperties?.properties?.title = "test title"
 batchUpdate.requests?.append(request)
 batchUpdate.requests = [request]
 let query = GTLRSheetsQuery_SpreadsheetsBatchUpdate.query(withObject: 
 batchUpdate, spreadsheetId: spreadSheetID)
 service.executeQuery(query, delegate: self, didFinish: 
 #selector(displayResultWithTicket3(ticket:finishedWithObject:error:)))
 }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to