I can't figure out an elementary mistake. When I run the following script the output I get is: <?= head1 ?> <?= head2 ?>
.
I'm trying to make head1
and head2
printing scriptlets where it references the google apps script and prints the relevant value defined in the google apps script.
Google Apps Script:
function openPage() {
var html = HtmlService.createHtmlOutputFromFile('Index');
SpreadsheetApp.getUi().showModalDialog(html, 'Sample Heading');
var question = 0;
var answer = 1;
var category = 2;
var to_publish = 3;
var publish_date = 4;
var questions_faq = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("FAQs");
var heading_1 = questions_faq.getRange("A1").getValue;
var heading_2 = questions_faq.getRange("B1").getValue;
var questions = questions_faq.getRange("A2:B" + questions_faq.getLastRow()).getValues();
html.head1 = heading_1;
html.head2 = heading_2;
}
and my html script is here:
<!DOCTYPE html>
<html>
<table>
<tr>
<th><?= head1 ?></th>
<th><?= head2 ?></th>
</tr>
</table>
<main></main>
<script> src = "Code.gs" </script>
</html>