Unable to set dependant drop down in google form
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to create a dependent drop-down list in Google form.
It should be working like this>>
Choose Country>>>>State>>>>City.
All of the choices should be linked in each other means when I choose country then I should be able to see the option of state and those state cities in the below boxes.
The values are inheriting from a google spreadsheet in this form. The reason why I have done that is to keep updating the values whenever require on the form directly from the spreadsheet (without making any changes in the form itself).
Now the problem is I am unable to create this drop down and not sure what would be further coding for the same.
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
javascript
add a comment |
I am trying to create a dependent drop-down list in Google form.
It should be working like this>>
Choose Country>>>>State>>>>City.
All of the choices should be linked in each other means when I choose country then I should be able to see the option of state and those state cities in the below boxes.
The values are inheriting from a google spreadsheet in this form. The reason why I have done that is to keep updating the values whenever require on the form directly from the spreadsheet (without making any changes in the form itself).
Now the problem is I am unable to create this drop down and not sure what would be further coding for the same.
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
javascript
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01
add a comment |
I am trying to create a dependent drop-down list in Google form.
It should be working like this>>
Choose Country>>>>State>>>>City.
All of the choices should be linked in each other means when I choose country then I should be able to see the option of state and those state cities in the below boxes.
The values are inheriting from a google spreadsheet in this form. The reason why I have done that is to keep updating the values whenever require on the form directly from the spreadsheet (without making any changes in the form itself).
Now the problem is I am unable to create this drop down and not sure what would be further coding for the same.
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
javascript
I am trying to create a dependent drop-down list in Google form.
It should be working like this>>
Choose Country>>>>State>>>>City.
All of the choices should be linked in each other means when I choose country then I should be able to see the option of state and those state cities in the below boxes.
The values are inheriting from a google spreadsheet in this form. The reason why I have done that is to keep updating the values whenever require on the form directly from the spreadsheet (without making any changes in the form itself).
Now the problem is I am unable to create this drop down and not sure what would be further coding for the same.
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
function updateForm(){
// call your form and connect to the drop-down item
var form = FormApp.openById("10zx_500WegcUAYJk1vvnRF3zYMAXk0BHfHrKejnIxM0");
var CountryList = form.getItemById("1372435040").asListItem();
// identify the sheet where the data resides needed to populate the drop-down
var ss = SpreadsheetApp.getActive();
var names = ss.getSheetByName("Country");
// grab the values in the first column of the sheet - use 2 to skip header row
var namesValues = names.getRange(1, 1, names.getMaxRows() - 1).getValues();
var Country = ;
// convert the array ignoring empty cells
for(var i = 0; i < namesValues.length; i++)
if(namesValues[i][0] != "")
Country[i] = namesValues[i][0];
// populate the drop-down with the array data
CountryList.setChoiceValues(Country);
javascript
javascript
edited Jan 3 at 15:37


James Z
11.2k71936
11.2k71936
asked Jan 3 at 9:23


Amardeep 01Amardeep 01
11
11
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01
add a comment |
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019403%2funable-to-set-dependant-drop-down-in-google-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019403%2funable-to-set-dependant-drop-down-in-google-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Telling people (who help you for free) to work harder because of you being late on your deadlines, doesn't really usually encourage anyone to help you.
– James Z
Jan 3 at 15:38
Oh, Ya Man!!! I have got a warning letter as well as the deadline for the same. Still no help from any one side. :-(
– Amardeep 01
Jan 11 at 14:01