Basing a script off of this tutorial - https://spreadsheet.dev/convert-each-row-google-sheets-into-slide-google-slides-apps-script, works perfectly fine. However I'm trying to populate a hyperlink as part of the script, i.e in my script
slide.replaceAllText("{{projectName}}", row[0]);
slide.replaceAllText("{{userStory}}", row[1]);
slide.replaceAllText("{{POC}}", row[2]);
slide.replaceAllText("{{stakeholderName}}", row[3]);
slide.replaceAllText("{{brief}}", row[4]);
"brief" in column 5 on my spreadsheet is a URL, and I'd like to have it not appear as the URL in my slide deck but as a hyperlink on the word "Brief".
I believe your goal is as follows.
{{brief}}
with the text of Brief
with the hyperlink of row[4]
on a slide in Google Slides.In this case, how about modifying your script as follows?
slide.replaceAllText("{{brief}}", row[4]);
slide.getShapes().forEach(shape => {
const text = shape.getText();
if (text.asString().includes("{{brief}}")) {
text.setText("Brief").getTextStyle().setLinkUrl(row[4]);
}
});
{{brief}}
is replaced with the text of Brief
with the hyperlink of row[4]
.