Copy a Template File into a Folder
A 3-step recipe with Google Drive. We can help you get access.
Recipe · 3 steps
Copy a Template File into a Folder
with Google Drive
Duplicate a template file into a destination folder with a new name.
- Read the template's metadata to confirm it exists and to capture its MIME type before copying, so a bad template id fails before any file is written.
- Copy the template, applying the new name and destination folder in the same request. The copy endpoint uses patch semantics, so the parents array supplied here replaces the template's own parents on the copy.
- Read the new copy back, selecting parents explicitly, to confirm it was renamed and filed into the destination folder rather than beside the template.
What you'll need to have ready
- templateFileId: The ID of the template file to copy.
- destinationFolderId: The ID of the folder the copy should be created in.
- copyName: The name to give the new copy (e.g. "Acme Corp - Proposal").
For your developer
Arazzo workflow google-drive:copy-template-into-folder, 3 operations: getFile → copyFile → getFile. Specs on APIs.io.