How to use apps script to clear data range when downloading in google sheets

50 views
Skip to first unread message

Tuyen Nguyen

unread,
Sep 11, 2024, 9:28:28 AM9/11/24
to Google Apps Script Community
Hi Everyone,
I have 01 file of google sheet with some sensetive data. I want to share this file to users and they will fill in data and get the result.
How to use the apps scrip to clear the data in 01 sheet (this sheet have formulas) if the editors downloading this file to their destop.
I expect to get your help.
Many thanks/Tuyen

Keith Andersen

unread,
Sep 11, 2024, 10:33:00 AM9/11/24
to google-apps-sc...@googlegroups.com

What do you mean: "they will fill in data and get the result."

How many users?



My website: https://sites.google.com/view/klaweb/
Passions: God, Family, Scriptures, Learning, Data Management, Google Sheets + App Script and much more!

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/1fe48c91-e9cd-431c-a323-66618673bb4cn%40googlegroups.com.

Tuyen Nguyen

unread,
Sep 15, 2024, 9:25:15 PM9/15/24
to Google Apps Script Community
Dear  Keith Andersen,
My idea to share this file for any users (editors) to input data for calculation and they get result (output). I dont want them to download this file.
If editors want to download this file then the formulas is deleted aumaticlly by Apps Script. 
So how to use Apps Script to clear 01 range or 01 sheet with formulars when downloading?
Pls help
Thks

Freelancer Techworld

unread,
Sep 16, 2024, 3:14:30 AM9/16/24
to google-apps-sc...@googlegroups.com
Hi Tuyen,

I would suggest creating a Google Forms for users to enter their data. The Forms will send the data back to the Google Sheets for calculation and then send the result to users. By doing this, users would not be able to see or change the sensitive data (and fomulars) in the Sheets.

P.S: Mình có nói tiếng Việt, nếu bạn cần giúp thêm thì liên hệ mình. Thân mến!

Keith Andersen

unread,
Sep 16, 2024, 3:27:51 AM9/16/24
to google-apps-sc...@googlegroups.com

There is no apps, script code or method whereby you can trigger deletion of formulas upon somebody downloading the file.

You didn't answer the question of how many users you have or anticipate?

Are you simply trying to protect the propriety of the formulas?

Or ... Do these formulas extract sensitive data from a main database and that is what you were trying to protect?

Some example of your process would go a long way in helping you figure out a solution.



My website: https://sites.google.com/view/klaweb/
Passions: God, Family, Scriptures, Learning, Data Management, Google Sheets + App Script and much more!

Reply all
Reply to author
Forward
0 new messages