a-marenkov / gsheets

A Dart library for working with Google Sheets API.
Other
79 stars 31 forks source link

I cannot create a new spreadsheet using createSpreadsheet() #30

Closed sathya4code closed 4 years ago

sathya4code commented 4 years ago

Hi,

I tried to create new Spreadsheet using gsheets.createSpreadsheet('GSheet/GSheetTest');. It is returning the data like id. But i cannot find the sheet in google drive. I cant understand whats going on. Anyone can help me?

a-marenkov commented 4 years ago

GSheet/GSheetTest

Hi @sathya4code

The spreadsheet created with service account belongs to it, so it should be found there.

What you're probably trying to achieve is done by following:

  final gsheets = GSheets(_credentials);
  final ss = await gsheets.createSpreadsheet('GSheet/GSheetTest');
  print(ss.id);
  await ss.share('{YOUR_EMAIL}@gmail.com', role: PermRole.owner);

Could you please let me know if it helps. Thanks!

sathya4code commented 4 years ago

GSheet/GSheetTest

Hi @sathya4code

The spreadsheet created with service account belongs to it, so it should be found there.

What you're probably trying to achieve is done by following:

  final gsheets = GSheets(_credentials);
  final ss = await gsheets.createSpreadsheet('GSheet/GSheetTest');
  print(ss.id);
  await ss.share('{YOUR_EMAIL}@gmail.com', role: PermRole.owner);

Could you please let me know if it helps. Thanks!

Hi @a-marenkov,

Thank you for your response.