I have this Google sheet table. I want to send this data to Google slides
I would like to group rows in one slide. For instance, A to C can be grouped in one slide and D to F can be grouped in another slide. Or maybe group D and F together in one slide and A to C in individual slides. So I want a code that accounts for these conditions.
Currently, I have the below script mentioned here. This script creates slides for each row and works perfectly fine.
function newPresentation() {
let templateId = "XXX";
let presentationTemplate = DriveApp.getFileById(templateId);
let copy = presentationTemplate.makeCopy().getId();
let deck = SlidesApp.openById(copy);
let slides = deck.getSlides();
let dataRange = SpreadsheetApp.getActive().getDataRange();
const ar = ["{{item}}", "{{results}}"]; // Sample object for replacing the placeholders.
const [, ...sheetContents] = dataRange.getDisplayValues();
slides.forEach((slide, i) => ar.forEach((f, j) => slide.replaceAllText(f, sheetContents[i][j])));
}
Here is the final result sample that I want - https://docs.google.com/presentation/d/1jKXnvhINF2Qz1CYn9BpzHW0Xuj_cZ_Q1IULZpe8Sjp4/edit?usp=sharing
Here is the Master Template - https://docs.google.com/presentation/d/1NM1gUIkiOk7bRA2VhDScoa-8ph-6ike6Fuyrv4ngcuw/edit?usp=sharing
