Getting Data from Google sheets API to Variable

Hi guys,

so im pretty new when it comes to things like programming/ API and so on. I barely manage to automate some web task.

Im working with to get data from my sheets with the Rest API.

How am i able to get all the Data in the Column Full Names to a Variable?

I haven't looked at this for a while, but I think that Google's applications programming interface for those applications is only for code evaluation in a sandboxed instance of the Chrome javascript interpreter, to which outside processes (like user scripts and Keyboard Maestro actions) are allowed no access.

In other words, the clipboard (rather than any Sheets interface scripting) may be the obvious route:

  • Select the column
  • Copy
  • Extract a list of rows from the plain text (public.utf8-plain-text) component of the clipboard

(Or possibly, if you need any formatting, from the public.html pasteboard)

(Or if attempts at over-ambitious degrees of automation are delaying you, then the fastest route may simply be copy paste)

I routinely use KM to process information from Google Sheets, but I do it by setting up Apps Script (within Google Sheets) to create (or overwrite) text files in Google Drive, based on data in the spreadsheet. Usually, I have a trigger in Google set up to update the corresponding text file whenever the spreadsheet changes (i.e., an "On Change" trigger). Various KM macros can then either read the text files into KM variables for processing, or KM can directly use (i.e., read and edit) the text files.

1 Like

If you willing to try the Shortcuts way, there's an app you can purchase to read and write data to google sheets.