asandroq
asandroq

Reputation: 575

Select another script project for a Google Form

I have copied a Google form, a spreadsheet and a scripting project from another Google drive. When I access the "Script Editor" menu from the form editing interface, it shows a few scripting projects to choose from, but not the one now in my drive. How do I change which project the form is attached to?

Upvotes: 0

Views: 42

Answers (1)

Iamblichus
Iamblichus

Reputation: 19339

Using Apps Script:

As others said, you can do this with Apps Script API. You would have to follow these steps:

  • Call projects.getContent: provide the scriptId of the standalone script you have in My Drive, and retrieve the field "files".
  • Call projects.create to create a new, empty project bound to the Form. Crucially, you have to provide the ID of the Form file in parentId, in the request body. The response will be the created project. You have to retrieve the parameter scriptId from this response.
  • Call projects.updateContent: provide (1) the scriptId retrieved in previous step as a parameter, and (2) in the request body, provide the "files" field you retrieved in the first step. This way, all files in the standalone script get copied to the bound script.

Other ways:

All in all, it's probably not worth following these steps, and depending on your situation it could be more comfortable to just manually copying all script contents to the bound script.

Reference:

Upvotes: 1

Related Questions