0

I'm trying to make question 5 appear only if cell F1 is not empty.

//Question5 test
var Title = setupSheet.getRange('F1');
if( Title == "" ){
}
else {
  form.addMultipleChoiceItem()
  .setTitle(setupSheet.getRange('F1').getValue())
  .setChoiceValues(setupSheet.getRange(2,6,setupSheet.getLastRow()-1,1).getValues());
}
ross
  • 2,684
  • 2
  • 13
  • 22
Bernardo
  • 53
  • 1
  • 10
  • And your problem is? – Tedinoz Jul 29 '19 at 11:17
  • this is not working, the question keeps appearing empty in the google form – Bernardo Jul 29 '19 at 11:30
  • `var Title = setupSheet.getRange('F1');` only defines the range; it doesn't return the value.. You need something like `var Title = setupSheet.getRange('F1').getValue();` that can evaluate the contents of "Title". You might also look at [Google Spreadheets Scripts: check if cell is empty](https://stackoverflow.com/q/41664971/1330560) to see some options for testing for the existence of "Title". – Tedinoz Jul 30 '19 at 00:04

0 Answers0