We're developing a system where we're ingesting Google Sheets into database tables. We wanted to introduce a feature where if the sheet is modified only then it should be considered for ingestion. This would've worked in case of manual changes but not in case of import range.
We're using (google drive)Java library to do this for us. Is there a field which would let us know if there is import range present so that we can skip checking for that file and ingest automatically?
Related
I'm trying to generate a dashboard using information from Google Sheets.
I would like to be able to import the sheet ID dynamically (using URL params), but Redash won't allow it (unless the viewer has full database access) because it's a text parameter.
I get that it might be dangerous if you're using a database to import information (SQL injection), but I don't see why it could be dangerous using Google Sheets.
Is there a work around for this? Am I missing something as to why I shouldn't do this?
Cheers!
I am trying to import this table into a Google Spreadsheet:
The table is available here:
https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4
Before Google changed their Spreadsheet addresses, I had the import working with ImportHTML(URL, "table", 2) - but this no longer works, even though there appears to be only two 'table' labels in the page HTML.
Looking for a way to abstract the table, I went to 'importXML' but tried several versions like 'importxml("https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4", "//div[contains(#id,'poule')]")'
and the same first part of the statement with "//table[contains(#class,'ruler')]")
but the formula fails with 'no content'
Would really appreciate some help to find a way to import this table!
Thanks in anticipation,
The reason you can't get the table data is because of the cookies page
Every time Google Sheets is trying to access that link, you need to accept cookies, and by default, Google Sheets won't do it.
You need to bypass or accept the cookies from the website to access data, you will need to implement more advanced things in Python or Google Apps Script
I'm trying to scrape an income statement for Apple (AAPL) into google sheets
https://finance.yahoo.com/quote/AAPL/financials?p=AAPL
First off I'd like to say I'm new to using anything technical or function related for computers so sorry if its a dumb question but I'm aware sheets has built in import functions for web data and I tried using the IMPORTXML function and I couldn't find the right xpath for the whole income statement
So my questions are
Which Import function would be best for scraping the income statement into sheets
Whichever function is the best how can I do it.
Would I repeat the steps that you show me if I wanted to scrape the balance sheet and cash flow as well
Thank you for your time
It seems that you are trying to fetch dynamically generated data in the link you've provided. Import functions cannot be used or cannot function properly in dynamically generated data as well as in websites which data are being controlled by JavaScript.
I suggest finding another link or website that will provide you with the same data and can be fetched through IMPORT functions by taking into consideration the mentioned limitations above.
I'm writing an app that needs to record data in a Google Spreadsheet with Swift.
I'm just really uncertain how to actually get started! I set up the Google sheets API in the Google API console and in my cocoapods following the Quickstart provided by google. Google's libraries GoogleAPIClientForREST and GTMOAuth2 are in my app and are ready to be used.
I basically just need to read and write to an existing spreadsheet but I do not know how to create the spreadsheet and refer to it so I can read and write to it as needed.
Thanks!
Whenever I want to read or write to a Google spreadsheet using the Sheets API, I refer to Reading & Writing Cell Values.
Basic Reading
The following spreadsheets.values.get request reads the values stored in the range Sheet1!A1:D5 and returns them in the response. Empty trailing rows and columns are omitted.
GET https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:D5
Basic Writing
Starting with a new, blank spreadsheet, the following spreadsheets.values.update request will write the values to the range Sheet1!A1:D5. The ValueInputOption query parameter is required and determines if the values written will be parsed (for example, whether or not a string is converted into a date).
PUT https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:D5?valueInputOption=USER_ENTERED
Here's the iOS Swift Quickstart for your code reference.
We use SAS to manage our data, and we have a table that updates every day.
We use Google sheets to create a dashboard.
In this regard I would like to have Google Sheets access the table directly and import all the data, instead of me manually importing the data
Is there a way to do this?
Google sheets does not allow direct import of SAS datasets, according to this page:
https://support.google.com/docs/answer/40608?hl=en
However, you can run a SAS program as a batch job to export your SAS dataset to csv or one of the other supported formats, then I think you could use Google Apps Script to automate the rest of the import, as per this answer:
How to automatically import data from uploaded CSV or XLS file into Google Sheets