I’m a complete noob and have little experience, but what I’m trying to achieve should be easy. I hope at least. I’m using this as my script:
function onOpen() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var currentPermissions = DriveApp.getFileById(spreadsheet.getId()).getSharingAccess();
if (currentPermissions !== DriveApp.Access.ANYONE_WITH_LINK) {
DriveApp.getFileById(spreadsheet.getId()).setSharing(
DriveApp.Access.ANYONE_WITH_LINK,
DriveApp.Permission.VIEW
);
}
I am using Zapier to make a copy of a Spreadsheet then add the link to our CRM. But the issue is that the Copied sheets are Restricted by default. It changes the permissions if I run it manually on a Sheet, but when I create a Copy the Trigger doesn’t copy.
I have tried a number of different things in Zapier to adjust the flow but it doesn’t quite get me where I want. I talk to GSuite about permissions, etc, and they directed me towards using a Script which I assumed would be necessary. I’ve poked around a bit but haven’t seen my exact use case. Any suggestions for getting this to trigger ON a copied Sheet so that it’s Shared automatically?
Hunter Jones is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.