How to send a picture to a Google Sheet cell

Hi! I can’t send an image from the app to the Google Sheet cell. Texts are sent normally, but images are not. Only links to images in your smartphone.

Welcome @Vasily to the community
I think it is not possible to store images in google sheets.
But you should upload the images on cloudinary and then store their links in google sheet

Google Sheets gives you two options: insert an image in cell or insert an image over cells . You can see the second option here: the image is floating on top of the spreadsheet.

I am not saying that google does not accept image I am saying I think it cant be happen in kodular

Why not?

A developer should be able to paste a formula into a google cell which will point to an image url

1 Like

If you don’t mind, you can give an example?

Maybe

you can do it with google apps script.

What I would probably do:

  1. Create a google apps script web app that
    a. uploaded an base64 encoded image to google drive and returned its ID
    b. appended a row to a spreadsheet, creating a formula (like those you have already shown) to display the image in a sheet cell

Perhaps something like this:

function doPost(e) {
  var data = Utilities.base64Decode(e.parameters.data);
  var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
  var fileID = DriveApp.getFolderById('< A FOLDER ID OF YOUR CHOICE >').createFile(blob).getId();
  return ContentService.createTextOutput(fileID);

  var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/<YOUR SPREADSHEET FILE ID HERE>/edit#gid=0");
  var sheet = ss.getSheetByName("Sheet1"); 
  
  sheet.appendRow(['=image("https://drive.google.com/uc?id=' + fileID + '")']);
}
  1. In the app
    a. image encoding and uploading routine

Some resources:

HOWTO: Create a Google Apps Script Web App bound to a Spreadsheet

Upload Any File To Google Drive with AI2

Post Data to a Google Sheet

2 Likes

Thank you, Timai2!

This post was flagged by the community and is temporarily hidden.

This post was flagged by the community and is temporarily hidden.