Reputation: 1212
A Google Form was created and I built a script for another department that does a small workflow using the onFormSubmit
trigger. It's built in the responses spreadsheet. The whole workflow is working just fine, but all the emails are sent as me.
There is an account managed by the department that will use this process and I would like to change the execution context to that address so when the email shows up, it's from the relevant department not some random person(me).
I tried deploying as web app and I changed it to 'whomever is logged in' but that didn't work. I would like to give this to the department, have them authorize the script and have them own it. Nobody else that the sheet is shared with showed up in the dropdown either.
It's a bound script inside the Google Spreadsheet that houses the responses from a forms submission.
So really just looking for some guidance on changing who executes a bound apps script.
Thanks.
Upvotes: 0
Views: 91
Reputation: 3845
In this case the trigger is run with the effective user credentials. As you were the one that has the ownership and the one who created the trigger, you are the Effective user.
Here you can find the description of effective user and active user.
To change this, you would need to change the ownership of both, the form and the spreadsheet where the trigger is being executed. Check this documentation for that.
I made a simple test and found that the trigger i made stopped working after i change the ownership. So i deleted the trigger and created a new one but now in the account that owns the form.
Hope it helps.
Upvotes: 2