0

I have created an Google Apps Script project that can create an Form via the script. Now I want to fire this script remotely form an C# application.

I have tried many different possibilities but I am unable to find a solution/clear answer on how to fire this script remotely without getting an consent window first.

Is this possibly? If yes, how?

Can someone point me in the right direction please. Thank you.

Niels
  • 416
  • 5
  • 22
  • Is this a script which would require you to be logged in, or would it be something that potentially anyone could activate? Is it an option to log-in once and store the token for future uses, or is logging in never going to be an option? – sinaraheneba Jul 24 '19 at 09:01
  • @sinaraheneba Preferably a script no one else can activate. But I would like to create the script dynamicly (in a later phase) and after creating the script, run it. So that I can create an different form every time. Logging in is never going to be an option. – Niels Jul 24 '19 at 09:12
  • Out of my depth, but you might find consulting [how clasp does it](https://github.com/google/clasp) to be of help. Best of luck – sinaraheneba Jul 24 '19 at 09:18
  • I suggest you take a look at the [App Script API documentation](https://developers.google.com/apps-script/api/concepts/), I was unable to find a C# guide, but there are many others that may work with you. In theory, this API should do what you want, it's to run existing scripts remotely. – AMolina Jul 24 '19 at 09:59
  • @Alberto, I have a problem with authenticating (because I can't get it to work without consent window), not the running a script remotely. – Niels Jul 24 '19 at 10:34
  • I think you could use a webapp to trigger the google apps script with [google.script.run](https://developers.google.com/apps-script/guides/html/communication) and you could use different query strings to select different forms. Look at the doGet(e) event object [here](https://developers.google.com/apps-script/guides/web). I have an [example](https://stackoverflow.com/a/55770563/7215091) that shows how you can use it although it's a much simpler example than you desire. – Cooper Jul 24 '19 at 15:20
  • To add on to @Cooper 's answer, I understand you can set permissions for web app deployment in a way that users of the app will not need to personally authorize. [This documentation](https://developers.google.com/apps-script/guides/web#permissions), which cooper also suggested explains how to set this. – AMolina Jul 25 '19 at 10:33

0 Answers0