title: Auto fill google slide template from google spreadsheet data
body: <p>Am new to google app script.</p>
  <p>Am trying to Auto fill a google slide template with some data from spread sheet.</p>
  <p>I created a list in the spreadsheet containing the data.</p>
  <pre><code>function onOpen() {
    const ui = SpreadsheetApp.getUi();
    ui.createMenu('COS Auto Fill').addItem('COS Auto Fill',
      'Presentation_Call').addToUi();
  }
  
  function Presentation_Call() {
    var range = SpreadsheetApp.getActiveSheet().getRange('G1'); 
    var value = range.getValue();
  }
  
  function fillTemplate() {
    var presentation = SlidesApp.openById(Presentation_Call);
    var values = SpreadsheetApp.getActive().getDataRange().getValues();
    values.forEach(function (row) {
      var templateVariable = row[1];
      var templateValue = row[2];
      presentation.replaceAllText(templateVariable, templateValue);
    });
  }
  </code></pre>
  <p>Spreadsheet Link</p>
  <pre><code>https://docs.google.com/spreadsheets/d/1J11tI2O5NUEr_2HpYYgCrseh9U_0KWF5YJeZ2uOV2gE/edit#gid=0
  </code></pre>
  <p>Google Slides Link</p>
  <pre><code>https://docs.google.com/presentation/d/10vGaLWo1ro1d3jzUrEVwOjozHHkxWCMzHEcikqwl_08/edit#slide=id.p1`
  </code></pre>
  <p>What I want to do is replacing the {{Number}} in the google slides template with the corresponding data from Gsheet.</p>
  <p>By opening the presentation using the presentation ID that is being called from a fixed cell in Gsheet then update the template variable.</p>
  <p>Thanks in advance.</p>