Want to change Google slides element location based on sheets value

Viewed 19

I have a Google slides presentation that I've set up to get populated by values in a Google spreadsheet via an Apps Script below

function fillTemplate() {
  var Presentation_ID= "###";

  var Presentation=SlidesApp.openById(Presentation_ID)
  var values= SpreadsheetApp.getActive().getDataRange().getValues();

  values.forEach(function(row){
    var templateVariable= row[0];
    var templateValue= row[1]
    Presentation.replaceAllText(templateVariable,templateValue);

  });
  
}

It is pretty straightforward, and does a great job filling the template with the needed values.

A function I'd like to add, however, is to check the values of some of the variables, and depending on the value, change the height of an element on a slide.

i.e. templateVariable 'Q1A' is equal to either 'a', 'b', 'c', or 'd', and depending on which, an element on slide 'Q1' would go to 1 of 4 determined heights when the code is ran.

I would be happy to establish any sort of barter for assistance in this matter. Thank you

0 Answers
Related