Gviz Private Gsheet

Hello guys, I don’t understand. I was following the “gviz to Private” method, but I am not successful in obtaining the values in my spreadsheet.

I should get some information right after getting the script’s URL, right?

Any idea where the error is?

car ==

Givz to Private = METRIC RAT AI2 - Use gviz to get or query PRIVATE google sheet data

@King1 , when web got text block use this


The issue looks like it is in the web app (without seeing your data or your select query). Did you follow all the instructions to create the web app script and to edit the manifest file correctly? Go back to the howto and compare what you have with what is there. Also, after any changes to your web app, you must publish/deploy a new version (and check that the script url remains the same if using the new editor).

1 Like

tried but while saving it says this error

eventhough no mistake

Now i am getting values correctly. I just ignored the error. Thank you TimAi2

I am receiving the value: ()

Wait, when pasting the guide’s URL into the browser, I received the message: “Success: undefined, undefined added”

Apparently, I’m getting an error on line 27 of my code. When pasting the URL, I received the value:


Exception: Request failed for https://docs.google.com returned code 401. Truncated server response: Unauthorized
Error 401
(use muteHttpExceptions option to examine full response) (line 27, file “Code”)

Yes, the URL remained the same after the changes.
My Script:


Sorry for the delay, my messages need to be approved.

Did you insert these codes in to the manifest file

For what it is worth, I tested the demo app I created and wrote the HOWTO from, and even created an entirely new web app from scratch. These both worked OK.

For a variety of reasons, I am using the legacy script editor (but this should not make any difference…)

1.Download the demo app from the link
2. Add the script codes and deploy it.
3. Then second code too in manifest file
4. Deploy again and copy the script url
5. Paste into the global variable
6. Add your sheet name into the variable, then test it. Simple

@Still-learning - nearly… :wink:

  1. Add the script codes
    Publish the web app and give permissions
  2. Add the second code too in manifest file
    Publish the web app again and give new permissions
  3. Deploy the url

The order of things is important otherwise the script editor will crash. You must publish the web app before you do anything to the manifest file.

Also, because we are using doGet(e), you can test the script in a browser, just supply the required parameters and you should get results back.

After doin everything and if you search the script URL you will get result like this

If it show the same result then your process is correct and the query alone is mistake.

Recheck your process and redo from the beginning

Well, I did it again and everything is working perfectly. I don’t understand what could have gone wrong the other time.
I’m adding values to my spreadsheet without any problems.

I’m looking for a guide where I can learn how to create a list that allows me to search for a specific value, change data and get the line number.

Well, I’m going to work on that. (Sorry SankaR, I couldn’t do it the way you told me). But I appreciate it.




This is it. Your web URL is totally wrong.
Show Ur spreadsheet and tell us what you wanna to filter

Gsheet screenshot and no need of URL or complete sheet

I want to filter by “id” or “color”.



@King1 ,

then use block

> &query=SELECT B,C where A=

Do not forget to add the grid name . In this block you can select B & C just by putting number alone in the text box.

When assembling the blocks, everything is correct. I believe that what you mentioned is true.

“My problem must be in my URL”.

I got a “random” value by doing the search.

Show your result after using the script or share your script url

right now i am going with ghseets only as the users count might go above 1200.

if more similar value found it may lead to get random values. try to use exact number to get relevant data

There is no value “200” in my spreadsheet.

I added the URL I got after publishing the script. That’s right?
I can add values with this, but I am not getting results.