在Google Drive Picker中创建新的电子表格。

huangapple go评论65阅读模式
英文:

Create new spreadsheet in Google Drive Picker

问题

我使用Google Drive Picker前端库显示电子表格。有一个问题是,我希望用户还能够直接从Picker创建新的电子表格,而不必转到Google Drive创建电子表格并选择它。这可能吗?我正在使用的范围是https://www.googleapis.com/auth/drive.file

英文:

I'm using the Google Drive Picker frontend library for showing spreadsheets. One problem is that I would like the user to also be able to create a new spreadsheet directly from the Picker, instead of having to go to Google Drive, create a spreadsheet and select it. Is this possible? The scope I'm using is https://www.googleapis.com/auth/drive.file.

答案1

得分: 1

抱歉,以下是翻译的内容:

我担心你不能使用或修改Drive Picker API中的视图来创建文件,而只能用它来可视化和选择文件。要创建文件,你需要使用Drive API的files.create方法。

根据你的具体用例,使用files.create方法可能对用户体验更好,因为通过该方法,你已经在文件创建时获得了文件实例,可以在你的应用程序中立即使用,因此你可以省去使用Drive Picker API的视图手动搜索文件并选择文件的步骤。

我建议你添加两个按钮:

  1. 使用Drive Picker API搜索现有文件。
  2. 创建新文件并立即开始使用该文件,通过读取创建文件时获得的文件实例。

作为额外的建议,我认为在Drive Picker API中添加创建文件选项会更方便。你可以在Google的问题跟踪器中提交功能请求,以便他们可能会在不久的将来考虑添加此功能(请参见下面的链接)。

参考链接:

英文:

I am afraid you can't use or modify the view from the Drive Picker API to create files but only to visualize and select them. In order to create files you need the Drive API files.create method.

Depending on your particular use case this could even be better for the user experience because with the files.create method you already obtain a file instance upon the file creation for any particular use within your app, therefore you would be saving the step of having to manually search for the file within Drive using the view from the Drive Picker API and the select it.

What I would do is to have 2 buttons:

  1. To search for existing files using the Drive Picker API.
  2. To create a new file and immediately start working with that file by reading the file instance I get from creating it.

As an additional suggestion, I think it would be easier to have the option to create files within the Drive Picker API. You can submit a feature request in Google's issue tracker so that they may consider adding this in the near future (see link below).

References:

huangapple
  • 本文由 发表于 2023年5月10日 17:24:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216805.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定