-1

I have a Planning sheet with huge data. For every row will have 200+ columns (cells). I wanted to change the cell value from html page using appscript.

How can we change the cell value directly from Html Table view.

Please help.

Regards RS

  • It would be helpful if you shared a sample of the data as well as the code that generates the HTML, from what I understand you want to do a kind of CRUD using Google Apps Script, right? – Emel Nov 11 '21 at 13:56
  • You can use google.script.run. Please try doing you own code before asking us. – Cooper Nov 11 '21 at 16:39
  • Yes Emel looking for CRUD with spreadsheet edit with huge edit fields. – R S Kumar Yellapu Nov 16 '21 at 11:51
  • As @Cooper mentioned, you can retrieve the elements inside a SpreadSheet into a HTML. After that, you should follow the common steps to build a CRUD. You can follow this [guide](https://gist.github.com/Tito0269/2014c7001c89ed596171baea229d3363) on how to build a CRUD inside Apps Script – Emel Nov 17 '21 at 15:44

1 Answers1

1

Update value of cell in Spreadsheet from HTML page

function updatecellvaluefromhtmlpage() {
  let html = '<form><input type="text" name="thisvalue" size="25" placeholder = "Enter Value" /><br /><input type="button" value="Click to change value of A1 in Sheet1" onClick="google.script.run.changeValueOfA1(this.parentNode);" />'
  SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html),'Change Value Sheet1A1');
}

function changeValueOfA1(obj) {
  const ss=SpreadsheetApp.getActive();
  const sh = ss.getSheetByName('Sheet1');
  sh.getRange('A1').setValue(obj.thisvalue)
}

htmlservice

show modeless

google.script.run

Html Dialog:

enter image description here

Changed Cell:

enter image description here

Cooper
  • 59,616
  • 6
  • 23
  • 54