So if I'm getting this correctly you want the following:
For every unique entry make a new Google Sheets (so a new file, not just a tab)
First things first
You'll have to create a template document which you'll copy every time a new document's made. So for this example, I'll use a sheet called templateSheet
as the template, and I'll refer to the main sheet as masterSheet
.
Master sheet
Try using this code and filling out the variable templateSheet
with the id of your templateSheet
function myFunction() {
// Template sheet stuff
// Insert id of template sheet
const templateSheet = "";
const templateSheetObj = DriveApp.getFileById(`${templateSheet}`);
// Main sheet stuff
const ss = SpreadsheetApp.getActiveSheet();
const allData = ss.getRange(2, 1, ss.getLastRow() - 1, 6).getValues();
let usersDone = [];
for (const entry of allData) {
const fullName = entry[1];
if (!usersDone.includes(fullName)) {
// this makes a copy and sets the title of document to fullname variable
const copy = templateSheetObj.makeCopy(fullName)
usersDone.push(fullName);
}
}
}
Output
How my Drive folder now looks
Content of new document
Since you have the new sheet object saved in copy
you can freely do whatever with the new copy, like adding all the rows of data or anything like that.