Google Apps Script e.namedValues format multiple choice

后端 未结 1 1972
悲&欢浪女
悲&欢浪女 2021-01-22 11:55

I have a simple script that emails the results of a Google Drive form submission. One of the questions in the form has multiple choice checkboxes. I am using e.namedValues to gr

相关标签:
1条回答
  • 2021-01-22 12:41

    Use JavaScript String's split function

    var multiple = e.namedValues['Multiple Choice Question'].toString();
    var choicesSelected = multiple.split(',');
    multiple =''; 
    for(var i in choicesSelected){
      multiple += choicesSelected[i] + '\n' ;
    }
    for (var i in multiple){
      Logger.log(multiple[i]);
    }
    
    0 讨论(0)
提交回复
热议问题