TransWikia.com

Pulling Data automatically, and keeping it Dynamic

Stack Overflow Asked by Andrew Ferro on November 4, 2021

Lets say I have data on an Amazon S3 Server, and I need to pull specific parts of that data into a Google sheet. It needs to update dynamically based on new inputs into the bucket, but everything in the bucket is simply a csv and as such is not dynamic.

Is there a Google Apps Script that I can write to run from Google Sheets that can pull data from a bucket or server?

One Answer

I wouldn't use a google script at all. I would just use the google sheets function

importdata(url)

You mentioned that you needed a subset of the data, so hide the sheet above and then create a reference in another sheet for the fields that you need. Easy peasy -- then just make sure that your sheet is set to recalculate on the interval that you need.

Edit:

Pulling data on an interval:

I believe if you go to 'File' --> spreadsheet settings --> Calculation and then select the Recalculation interval to on change and every hour (or minute), it will automatically pull the data again on that interval.

If you want to have more control over when the data refreshes though you in the above step, set the calculation to `on change' only and then add the following script:

function refreshdata() {
SpreadsheetApp.getActive().getSheetByName('[sheetname goes here]').getRange('A1').setValue('=importdata("[your url here]")')
}

and then add a trigger for the function refreshdata to run on the interval you want the data to be refreshed on.

Answered by Rob on November 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP