I am attempting to transfer data from my current SpreadSheet to an HTML file created with Google App Script. Any guidance on this would be greatly appreciated as I am feeling a bit lost.
Html
<body>
<!--3.x snippet-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!--2.x snippet-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!--1.x snippet-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Source -->
<!-- Google Hosted Libraries: https://developers.google.com/speed/libraries#jquery -->
<script>
window.writeData = function() {
var userInformation = document.getElementById('form');
google.script.run.registerUser(userInformation);
};
</script>
<blockquote class="trello-card">
<a href="" id="myLink">Trello Card</a>
</blockquote>
<script src="https://p.trellocdn.com/embed.min.js"></script>
<script>
google.script.run.withSuccessHandler(myname => {
var elem = document.getElementById('myLink');
elem.href += myname;
console.log('This is myname:' + myname);
}).getCardById();
</script>
</body>
Function that should return the information of the sheet
function getCardById(){
var app = SpreadsheetApp;
var activeSp = app.getActiveSpreadsheet();
var activeSheet = activeSp.getActiveSheet();
var linkCol = activeSheet.getRange("B2").getValue();
//Logger.log(' LINKCOL:' + linkCol);
return linkCol;
}
Function that show the html
function seeCard() {
var templateFileId = '1upA3JHioEyxLScebasmsmwXW-SxsiKaPRznKLCKFYhw';
var sheetName = 'Trello sheet';
SpreadsheetApp.openById(templateFileId).copy(sheetName);
var excel = SpreadsheetApp.create("Probando un html interno a ver ")
var html = HtmlService.createHtmlOutputFromFile('index') //index is the name of your HTML file
.setTitle('Trello card')
.setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showSidebar(html);
}
Video of what is happening right now
video of the problem
*Picture in the console *