title: Google Docs Script editor checking if a formula exists in a cell
body: <p>I am trying to check a range of cells in a row to see if one is blank, if it is, I am inserting an image, if it is not blank, I am attempting to move to the next cell in the row to check that until the range is finished. </p>
  
  <p>So far I have this:</p>
  
  <pre><code>function gfc() {
  var stockitem = '=image("imageurlhere")';
  var item1 = getValue('g4');
  var item2 = getValue('h4');
  var item3 = getValue('i4');
  if (item1 == ''); {
  setValue('g4', stockitem);
  }
  else if (item2 == '') {
  setValue('h4', stockitem);
  }
  else {
  setValue('i4', stockitem);
  }
  }
  </code></pre>
  
  <p>The problem I am having is that the code works if I am inserting text, but if I am inserting the image it counts the image as a blank cell and re-inserts the image in the already image filled cell.</p>
  
  <p>E.G. If I insert an image into g4 because it was blank, that image would then be counted as blank again and re-inserted without going to the next step. I know I am missing something simple, any help will do, thank you!</p>