I have a google form where I have a multiple choice question "Territory field". This field is having two valid answer
I am trying to submit this form using google script (part of script mentioned below).
var formID = "xxxxxxxxxxxxxxxxxxxxxx";
var Formobj= FormApp.openById(formID);
var formResponse = Formobj.createResponse();
var items = Formobj.getItems();
var territory = items[1]
var territoryvalue = "United States"
if (territoryvalue.indexOf("United States") !== -1)
{
var territoryfield = territory.asMultipleChoiceItem()
var territoryresponse = territoryfield .createResponse([["United States"]])
formResponse.withItemResponse(territoryresponse);
}
Field value after form is submitted with United states as answer