Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
spreadsheet.values.append java example
// credential from ServiceAccount json file
GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream(p))
.createScoped(Collections.singleton(SheetsScopes.SPREADSHEETS));
Sheets service = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
.setApplicationName(APPLICATION_NAME)
.build();
AppendValuesResponse r = service.spreadsheets().values().append(
spreadsheetId,
range,
new ValueRange().setValues(
values
)
).setValueInputOption("RAW").execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment