Reputation: 13
The problem is that I have various spreadsheets (a) for which only one person has viewing and editing permissions, still other persons need some data from those spreadsheets (a) for their spreadsheets (b), they also need to be able to get an updated version of the data from the spreadsheets (a)
I created now a workaround using installable triggers with an on edit function (they have to change a specific field in the spreadsheet) to update the data, but the persons want to have a button/drawing which they can click or a menu entry to get the updated data from the spreadsheets (a).
From my perspective to combine an installable trigger with a button/drawing/menu entry is a dead end. Therefore my question is, if there is any other possibility to grant access to data from spreadsheets without giving viewing or editing rights to the documents where the data comes from...
Would be great if anybody would have an idea, thanks in advance
Upvotes: 1
Views: 2172
Reputation: 21
I might have an answer for your anomaly. My application client are people from my googleapp workgroup, they don't have permission to view the files, but they are not a complete strangers.
I think that the following might work. A file is the muster file with the code. B file has importrange() function from A with a sharing permission. And C file has importrange() from B with a sharing permmsion of B file. the small twist is that B file has a linked sheet which is hide and protected. I have check this, and if you are not the owner you will be able to unhide it.
In practice, my filling is that you can pull a similar trick with 2 SpreadSheets, the third one is for extra safety.
Upvotes: 0
Reputation: 21
I'm facing a similar problem.
I think that i found a workaround but no guarantee.
I used the importrange
function which i intend to control via script.
I have tried the flush function and found it is a good trigger to force the importrange
to work, which I added to a Menu
(just in case).
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [];
menuEntries.push({name: "Refresh", functionName: "SheetFlush"});
ss.addMenu("Menu", menuEntries);
}
function SheetFlush() {
SpreadsheetApp.flush();
}
Now, as i don't want the B
user to know the A
SS unique address.
(when looking to the importrange
function)
I am protecting and hiding the sheet with the importrange
function in the B
SS. And Im using an extra internal refernce in B
SS for the hidden sheet.
Upvotes: 0
Reputation: 422
There are some limits on the Triggers that are used in a spreadsheet that you are going to run into. Check out this for details. Essentially, and onEdit
trigger cannot access/modify another spreadsheet as They cannot access any services that require authentication as that user.
To update another spreadsheet outside of the current spreadsheet, I've simply installed a function and a menu item to trigger it. (Is this the dead end you speak of?) It does depend on the user to update the group, but that has been a benefit for my secure data as it requires the knowledge of the key holder to allow others the information. This is A
to B
, which is possible but B
has to have edit access to A
's spreadsheet.
No, B
cannot get information from A
unless they have access to it, as least as viewer. You cannot grant viewing privileges to individual cells, which is essentially what you want to do.
Without that ability, the solution is more in structuring the flow of the data. In one senerio where a user proved they can't be trusted to update the team regularly, I've create myself as 0
. I have permissions to A
and B
. I run the function from 0
to access A
and to update B
, which also sends them an email, so all know when the last update has happened. Why don't I just use A
spreadsheet to run the function, because from 0
I can access it and write it to B
without ever seeing the data. It's a veil of ignorance. I never actually open A
and 0
remains empty.
Best I could do.
Upvotes: 1