Instead of naming the copied file with an asterisk, how would I pull a name from list in column A of a different sheet to rename the new copy? For example, I have 100 names in column A on a sheet called "Names", and I want to copy a different sheet called "template", so I want to end up with 100 copies of my template, each renamed with a name from the 100 rows in column A of my "Names" sheet. How can I change the script code to do that?
You would use the getValues() method of the sheet and iterate over the ranges of the IDs of your template creating a template for each value retrieves and naming it with that value. Note! Creating a large number of files using the standard Google Apps Script libraries can be a little slow and it might be a better approach to copy files using batch operations with the Drive API advanced service.
Yes. Use `const ssNew = SpreadsheetApp.create("My new sheet");` then reference `ssNew` when copying the tab over. Check out the link to the playlist in the description on how to copy sheet tabs.
Sure, Google Has a handy example for this: developers.google.com/drive/picker/guides/overview You can add this to a modal dialogue in your Google Sheet.
Thank you, I can't see this anywhere else
what if the folder is inside folder?
You can also directly target a folder location with the DriveApp API.
Instead of naming the copied file with an asterisk, how would I pull a name from list in column A of a different sheet to rename the new copy?
For example, I have 100 names in column A on a sheet called "Names", and I want to copy a different sheet called "template", so I want to end up with 100 copies of my template, each renamed with a name from the 100 rows in column A of my "Names" sheet.
How can I change the script code to do that?
You would use the getValues() method of the sheet and iterate over the ranges of the IDs of your template creating a template for each value retrieves and naming it with that value.
Note! Creating a large number of files using the standard Google Apps Script libraries can be a little slow and it might be a better approach to copy files using batch operations with the Drive API advanced service.
Is it possible to copy a tab to a new spreadsheet?
Yes. Use `const ssNew = SpreadsheetApp.create("My new sheet");` then reference `ssNew` when copying the tab over.
Check out the link to the playlist in the description on how to copy sheet tabs.
Is there a way to just have it pop up the google drive picker? I've been playing with that when I hit my copy button but it's been unsuccessful.
Sure, Google Has a handy example for this: developers.google.com/drive/picker/guides/overview
You can add this to a modal dialogue in your Google Sheet.