When a click event occurs on my main.html page, I am able to retrieve the ID using the following code:
elements.table.on("rowClick", function(e, row){
//e - the click event object
//row - row component
const ID = row._row.data.ID;
google.script.run.makeRequest(ID);
});
The obtained ID is then passed to a backend function named makeRequest located in dataServerSide.gs.
function makeRequest(data){
let newData = data;
console.log(newData + "this is the first")
return newData;
}
Subsequently, I encountered difficulties in passing the data from the makeRequest function back to another HTML file called ProjectDetail.html. Here are some attempts that were made:
<script>
google.script.run.withSuccessHandler((incomingData) => {
console.log(incomingData)
}).makeRequest(data);
</script>
I also tried calling the makeRequest function without passing any arguments:
<script>
google.script.run.withSuccessHandler((incomingData) => {
console.log(incomingData)
}).makeRequest();
</script>
These methods did not yield the desired results. Any assistance will be greatly appreciated. Thank you for your time.
... (additional text has been omitted for brevity and focus) ...