问题
Does Google Data Studio Community connector support pagination?
I work with an external data service. The service returns data page by page. It requires start
and next
parameters and it requires 2 req/sec. Can I override a method like getData
or upgrade request
argument for implement this feature?
If it's not. Is there the best practice for getting data of this kind?
回答1:
Community Connectors do not support pagination for web APIs at present.
The best practice would depend on your use case. If you want to get the full dataset for user, you can make multiple UrlFetch
calls to get the full dataset, merge it, and return the merged set as the getdata()
response. It might also make sense to cache this result to avoid making a large number of requests in the short term. You can cache using Apps Script cache, or a Sheet, or even to BigQuery. Keep in mind that Apps Script has 6 min / execution limit.
However, if you want to return only specific pages, the only way to configure that would be through getConfig
since configparams
are passed with the getData()
request. Example use case would be returning only first n number of pages where n selected by user in the config.
来源:https://stackoverflow.com/questions/47165247/pagination-when-data-source-is-supporting-multi-page-requesting