简体   繁体   English

是否可以使用gs_ls()获得500多个结果?

[英]Is there any option to obtain more than 500 results with gs_ls()?

I'm trying to set a spreadsheet by their title, but when I use gs_ls I only obtain the last 500 sheets updated. 我正在尝试按标题设置电子表格,但是当我使用gs_ls时,我只会获取最近更新的500张纸。

I had tried to obtain an spreadsheet object using gs_title, but I obtained an error message with the message "doesn't match sheet_title of any sheet returned by gs_ls()" that's why I want to obtain more than the last 500 sheets updated. 我曾尝试使用gs_title获取电子表格对象,但是却收到一条错误消息,消息为“与gs_ls()返回的任何工作表的sheet_title不匹配”,这就是为什么我要获取比最近更新的500张还多的信息的原因。 My spreadsheet was updated previously than these 500 sheets. 我的电子表格之前的更新时间超过了500张。

> title=gs_title('XXXX')
Auto-refreshing stale OAuth token.
Error in gs_lookup(., "sheet_title", verbose) : 
  "XXXX" doesn't match sheet_title of any sheet returned by gs_ls() (which 
should reflect user's Google Sheets home screen).

I had the same problem using with gs_url and with gs_key. 使用gs_url和gs_key时遇到相同的问题。 I obtained the same message: "XXXX doesn't match sheet_key of any sheet returned by gs_ls()". 我得到了相同的消息:“ XXXX与gs_ls()返回的任何工作表的sheet_key不匹配”。

Is there any option to obtain more elements with gs_ls or to obtain the googlesheets object for a sheet not listed in gs_ls? 是否可以通过gs_ls获取更多元素或为gs_ls中未列出的工作表获取googlesheets对象?

As per the ?gs_ls() documentation: 根据?gs_ls()文档:

Which sheets show up in this table? 该表中显示哪些表? Certainly those owned by the user. 当然是那些用户拥有的。 But also a subset of the sheets owned by others but visible to the user. 但也属于其他人拥有但对用户可见的部分图纸。 We have yet to find explicit Google documentation on this matter. 我们尚未找到有关此问题的明确的Google文档。 Anecdotally, sheets owned by a third party but for which the user has read access seem to appear in this listing if the user has visited them in the browser. 有趣的是,如果用户在浏览器中访问过第三方,则该用户拥有的工作表似乎会出现在此列表中。 This is an important point for usability because a sheet can be summoned by title instead of key only if it appears in this listing. 这对可用性很重要,因为仅当表单出现在此列表中时,才能通过标题而不是密钥来召唤表单。 For shared sheets that may not appear in this listing, a more robust workflow is to specify the sheet via its browser URL or unique sheet key. 对于此列表中可能没有出现的共享工作表,更强大的工作流程是通过其浏览器URL或唯一工作表键指定工作表。

I found the solution, if you use gs_key or gs_url without specify conditions, you can't obtain the spreadsheets object if the sheet is not in gs_ls list. 我找到了解决方案,如果在不指定条件的情况下使用gs_key或gs_url,则如果工作表不在gs_ls列表中,则无法获取电子表格对象。 But using the lookup and visibility options, I could identify the sheet and obtain the spradsheets object. 但是,使用查找和可见性选项,我可以识别工作表并获取spradsheets对象。 For that you can use gs_key or gs_url: 为此,您可以使用gs_key或gs_url:

  key = gs_key('xxxxx', lookup = F, visibility = 'private')
  url = gs_url('xxxxx', lookup = F, visibility = 'private')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM