79436579

Date: 2025-02-13 14:56:05
Score: 1
Natty:
Report link

Setting an Image in a cell using SpreadsheetApp.newCellImage()

Using SpreadsheetApp.newCellImage() do work by using the following methods,.setSourceUrl().build() and here's a code snippet that could help.

function myFunction() {
  const image = "-DataURI-"
  const imageBuild = SpreadsheetApp.newCellImage().setSourceUrl(image).build()
  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.getRange(1, 1).setValue(imageBuild);
}

Sample Output:

Image Output

References:

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Lime Husky