What does "Get Data Using Function" do?

"Get Data Using Function" is an alternative way of fetching data into Google Sheets using a custom function called "SUPERMETRICS".


How to Use "Get Data Using Function"

When the sidebar is open and a query is not being modified, open the drop-down from the "Get Data to Table" button to find the options "Function" and "Function (+ params)".


With either of those selected, the "Get data to table" button changes to "Get Data Using Function" and clicking on it will insert the function into the sheet along with the results. If you click on the upper-left portion of the results in the table, you should then see the function:


If you use "Function (+params)", you will then see this, with updatable parameters added to the sheet.


  • Note: The query will no longer appear under the SupermetricsQueries sheet, and will need to be manipulated directly from the function or its parameters.


Benefits of Using Functions

  • Compared to normal data queries, it's faster.
  • Query parameters can easily be modified (they are right above the data and not on the SupermetricsQueries sheet).
  • Whenever the query parameters are modified, the data will automatically be updated to reflect the changes.


Downsides to Using Functions

  • Google allows custom functions to run for only 30 seconds, so this method of fetching data is suitable only for quick queries. If the time limit is exceeded, the function will display "#ERROR", with the details "Internal error executing the custom function."
  • The query information won't be visible along with your normal queries on the SupermetricsQueries sheet.
  • The authentication information for accessing the data is stored as an authentication token right inside the query, it's in the first query parameter starting "authentication_...". Anyone that has access to this token can fetch data from the specified data source using the credentials of the user account you used for creating the query. So don't share the token with anyone that shouldn't be able to get that data. If you need to revoke any tokens, you can do so here.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.