Enhanced Custom Function for Google Spreadsheet using Web Apps as Wrapper

136 views
Skip to first unread message

Tanaike

unread,
Jun 8, 2020, 1:54:32 AM6/8/20
to Google Apps Script Community
This is a proposal of the enhanced custom function for Google Spreadsheet using Web Apps as the wrapper.

When the custom function is used, in the current specification, the most methods except several methods (for example, one of them is UrlFetchApp.) that the authorization is required cannot be used. So for example, when the filenames in the folder are retrieved from the folder name, unfortunately, this cannot be directly achieved. When this is tried, an error like "Exception: You do not have permission to call DriveApp.getFoldersByName" occurs. From this situation, it is considered that when the authorization has already been done, the method that the authorization is required might be able to be used. In this report. I would like to introduce the method for using such methods by using Web Apps as the wrapper.


gilbert_RGI

unread,
Jul 4, 2020, 4:37:25 AM7/4/20
to Google Apps Script Community
hello Tanaike 
Curious I tried your scripts, the first to find the files in the drive works very well, it is not the same for the second and the third, I followed your instructions scrupulously but they give me a standard error : "Error: Sheets is not defined" What am I doing wrong? I am in France I modified "Sheet1" by "Feuille 1" in the function putValues() and the "," by ";" in the function DoGet() but not good results. 
Can you help me understand please thank you  


the functions in French are  :
=RUN("putValues";"sample1";"sample2";"sample3")
=RUN("setColors";LIGNE();COLONNE();10;15) 

20200704-102955-001.jpg

Tanaike

unread,
Jul 4, 2020, 10:00:27 PM7/4/20
to Google Apps Script Community
Thank you for your comment. I apologize for the inconvenience. If you use my sample script 2 and/or 3 of this , can I ask you whether you enabled Sheets API at Advanced Google service?

2020年7月4日土曜日 17:37:25 UTC+9 gilbert_RGI:

gilbert_RGI

unread,
Jul 5, 2020, 4:41:03 AM7/5/20
to Google Apps Script Community

Hello, and thank you, it's up to me to apologize for any inconvenience I may cause you. To answer your question, Yes of course as you had stipulated the API sheets services is well activated see the attached screenshot  

20200705-103253-001.jpg

Tanaike

unread,
Jul 5, 2020, 7:24:00 PM7/5/20
to Google Apps Script Community
Thank you for replying. I apologize for the inconvenience. I could understand that you have already enabled Sheets API at Advanced Google services. In that case, I cannot replicate your issue. So in order to correctly understand about your situation, can you provide the detail flow for replicating your issue? By this, I would like to confirm it.

2020年7月5日日曜日 17:41:03 UTC+9 gilbert_RGI:

gilbert_RGI

unread,
Jul 6, 2020, 4:08:44 AM7/6/20
to Google Apps Script Community
my code is identical to yours (except "Sheet1" replaced by "Feuille 1") , the  API sheet service is enabled 

https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/script.external_request

20200706-095356-001.jpg

20200706-100501-001.jpg 

Tanaike

unread,
Jul 6, 2020, 10:07:02 PM7/6/20
to Google Apps Script Community
Thank you for replying. When I tested it again, I confirmed that no error occurs again. But when Sheets API is enabled, the same error occurs. So I cannot replicate your situation under Sheets API is enabled. This is due to my poor skill. I deeply apologize for this. When I could correctly replicate your issue, I would like to think of the solution. I deeply apologize for my poor skill again.

By the way, can I ask you that when you redeployed Web Apps as new version, what result will you get? 

2020年7月6日月曜日 17:08:44 UTC+9 gilbert_RGI:

gilbert_RGI

unread,
Jul 7, 2020, 3:57:36 AM7/7/20
to Google Apps Script Community

Hello Super Tanaike

 I completely redid the project and happiness it works conclusion you must register the webapp before registering the code !!!! 

20200707-095128-001.jpg 

Reply all
Reply to author
Forward
0 new messages