In google apps Script you can insert an image into Google Spreadsheets using the insertImage
function (https://developers.google.com/apps-script/reference/spreadsheet/sheet#insertimageblob-column-row).
But I'm not using appscript. I'm using the Google Sheets API (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets) and I can't seem to find a way to do this. Is there any possible implementation?
You can insert any image into any cell in Google Sheets in just a few steps. To insert an image into a Google Sheets cell: Open your sheet and select an empty cell. Click Insert in the menu, then hover over the Image sub-menu.
On Mobile: Tap once on a cell to select. Tap again to bring up menu: Insert > Tap the “+” at the top of the screen > Image > Image in cell. Select an image from the options presented to you.
Return to Sheets and insert an image or drawing by selecting Insert > Image or Insert > Drawing. After inserting the image or drawing, click it. A small drop-down menu selector will appear in the top right-hand corner. Click it and choose Assign script.
Insert Multiple PicturesIn the Insert Picture window, hold CTRL on your keyboard and click on the pictures you want to insert. Then click Insert.
The V4 API doesn't have the ability to insert an image blob like Apps Script does (where the image is an overlay on the sheet, not associated with any cell). You may be able to workaround this using the =IMAGE function. We know of the gap in functionality and are looking into adding support for image blobs.
Set the formula with script like this:
function showImage() {
var ss=SpreadsheetApp.getActiveSpreadsheet()
var formulaSheet = ss.getSheetByName("Sheet1");
var formulaCell = formulaSheet.getRange("B5");
formulaCell.setFormula('=IMAGE("http://finviz.com/fut_chart.ashx?t=ES&p&p=m5&s=m",4,100,200)')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With