In general i want people to put some data into a google sheet and provide a button, which takes the data and automatically fills a prefabricated google slide. I have chosen the approach to duplicate a master slide and then replacing individual text modulars with the data. Is there a better approach for my goal?
This is the Master-Slide
This is the code i use for the duplication, but it is only able to duplicate the master slide once, because the objectId it creates, is always the same: "copiedSlide_001". I have tried to use a random integer for the objectId, but i dont get it to work. Also, i guess the name has to be predictable to be used in the next step. (importing the data into newly copied slide).
function duplicateSlide() {
var presentationId = "1XLtOv7FHWwv6R2QEZF_LEhF7twXTlY3IbvsVDKxdDtc";
var pageId = "g75e5d89173_0_0"
var requests = [{
"duplicateObject": {
"objectId": pageId,
"objectIds": {
"g75e5d89173_0_0": "copiedSlide_001",
}
}
} ]Slides.Presentations.batchUpdate({'requests': requests}, presentationId);
}
How do i get the duplication process to work in my favor?
I would appreciate any help highly!