Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to send automatically, auto generated google form Link/URL

using google apps script i wrote some code that will auto generate google form and a spreadsheet linked to the form to collect responses. also using triggers in apps script i set this script to auto generate a form every week. Everything is working as expected.

Instead of opening the form and using ‘send’ button to send the link/url as e-mail, i want the url of this auto generated form to be sent to a specific email automatically, as soon as it gets generated. searched a lot couldn’t find any leads so far. Is this even possible, if so please do help in finding the solution. TIA.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I believe your goal is as follows.

  • You want to create a new Google Form and retrieve the published link of the created Google Form. And, you want to send it as an email.
  • You want to achieve this using Google Apps Script.

In this case, how about the following sample script?

Sample script:

function myFunction() {
  const form = FormApp.create("sample form"); // Create a new Google Form.
  
  // Retrieve published URL.
  const url = form.getPublishedUrl();
  
  // Send the URL as an email.
  MailApp.sendEmail({
    to: "###", // Please set the email address.
    subject: "sample subject",
    body: url
  });
}
  • When this sample script is run, a new Google Form is created and the published URL is sent as an email.

  • This is a simple sample script. So, please modify this for your actual situation.

References:

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading