I have a sheet which one column (column 10) is a drop down list with 2 possibilities : official or non official. I'm trying to create a script that export this sheet to another with this condition : Each row with "Official" in the column 10 have to be duplicated as "non official" (so in this case we will have 2 rows one official and one non official)
So this is my code :
const tab = active_sheet.getRange("A2:M14").getValues();
for (let nbline=0; nbline <tab.length;nbline++) {
if (tab[nbline][10] == "official") {
And I don't find the command to duplicate this line, keep all information and just change the column 10 to "non official"
For exemple this is "tab" :
row 1 : a b c d e official f g h
row 2 : 1 2 3 4 5 non official 6 7 8
row 3 : x c v b x official m l k
row 4 : n j i o k non official 6 9 8
I want to have this :
row 1 : a b c d e official f g h
row 2 : a b c d e non official f g h
row 3 : 1 2 3 4 5 non official 6 7 8
row 4 : x c v b x official m l k
row 5 : x c v b x non official m l k
row 6 : n j i o k non official 6 9 8
If someone can help me
Thanks in advance !