I have a Google Spreadsheet that has an image on the 2nd and 3rd column of each row, and I am trying to log all of the spreadsheet data to the console (for now). I\'m havin
Range.getValue()
returns the computed value of a cell, which in this case is an image, not a URL. As you've found, you can use getFormula()
to get the formula that created the image. You can use a regular expression to extract the image URL from the formula string.
function getImageUrl(formula) {
var regex = /=image\("(.*)"/i;
var matches = formula.match(regex);
return matches ? matches[1] : null;
}
This won't work if the URL is computed from another cell or formula, but it should work for the simple case you have listed.
Use Find And replace Edit > Find and replace
And check Also search within formulas in Find and replace box