In Google Sheets, I have a layout created with HtmlService of Google Apps Script (see masterPage.html, below).
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<? var serverData = getServerData(); ?>
</head>
<body>
<h2>Page begin.</h2>
<p>Data A from server: <?= serverData[0] ?></p>
<?!= HtmlService.createHtmlOutputFromFile('includedPage').getContent(); ?>
<p>Page end.</p>
</body>
</html>
This layout calls HTML from a second layout called includedPage.html.
<? var serverData = getServerData(); ?>
<div>
<p>Data B from server: <?= serverData[1] ?></p>
</div>
I can use a G.A.S. scriptlet to get data ("Data A from server") from the server/sheet and into the master page.
However, the same scriptlet does not work when placed in the included page. The code simply renders as HTML and "Data B from server" is not displayed.
Is there a way to import server/sheet into the include page before the include page gets inserted into the master page?
Any assistance appreciated.
Note: the following questions are related to but do not answer my question: