How do we prevent automatically generated Forms from being generated while restricting users to organization?

Skip to first unread message

Google Apps Script Community

Nov 3, 2021, 4:30:23 PM11/3/21
to Google Apps Script Community
I have a little script creating submission forms pasted below. The forms that are produced come out with the setting to "restrict to users in (company name) and its trusted organizations)" enabled.

Is there something I can add to this script to make them come out with that setting disabled?

Thank you for your time!

function myFunction() {
//constants for testing
let campaignName = "Campaign Name";
let p1 = "Primary Product"
let p2 = "First Paired Product"
let p3 = "Second Paired Product"

var form = FormApp.create(campaignName + ' Stop Order Form');
var formID = form.getId();

const generatedForm = FormApp.openById(formID);

generatedForm.setTitle('Stop Order Form for ' + campaignName);

generatedForm.setConfirmationMessage("We appreciate your effort to ensure all customers are taken care of. Thank you for making this submission!")

var productMultiChoice = form.addMultipleChoiceItem();
var productMultiChoiceID = productMultiChoice.getId();
productMultiChoice.setTitle('Please choose the product that needs a Stop Order')
Logger.log('Published URL: ' + form.getPublishedUrl());
Logger.log('Editor URL: ' + form.getEditUrl());

var longURL = form.getPublishedUrl();
var shortURL = form.shortenFormUrl(longURL);

var ss = SpreadsheetApp.create('Stop Order Requests for ' + campaignName);

generatedForm.setDestination(FormApp.DestinationType.SPREADSHEET, ss.getId());

Brett Grear

Nov 4, 2021, 6:27:36 AM11/4/21
to Google Apps Script Community
should do the trick

Cuneiform Script

Oct 1, 2022, 10:49:08 AMOct 1
to Google Apps Script Community
Thank you, that is what I'm looking for
Reply all
Reply to author
0 new messages