{"id":11835,"date":"2023-12-29T07:00:00","date_gmt":"2023-12-29T01:30:00","guid":{"rendered":"https:\/\/selfimagination.in\/tips\/?p=11835"},"modified":"2023-12-29T16:41:42","modified_gmt":"2023-12-29T11:11:42","slug":"dependent-dropdowns-with-apps-script","status":"publish","type":"post","link":"https:\/\/selfimagination.in\/tips\/dependent-dropdowns-with-apps-script\/","title":{"rendered":"Google Sheets Dependent Dropdowns with Apps Script Tutorial"},"content":{"rendered":"\n<p>In this step-by-step tutorial, we&#8217;ll walk you through the process of creating dependent dropdown menus in Google Sheets using Apps Script. Learn how to make your data entry forms more efficient by dynamically populating options for selecting country, state, and city based on user choices.<\/p>\n\n\n\n<p>\u091c\u092c \u092d\u0940 \u0939\u092e\u0947 \u090f\u0915 Dropdown \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u0938\u0947 \u0905\u0928\u094d\u092f \u0915\u093f\u0938\u0940 dropdown \u0915\u0940 Value fill \u0915\u0930\u0935\u093e\u0928\u093e \u0939\u094b \u0924\u092c \u0939\u092e dependent dropdown \u092f\u093e Filter dropdown \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902\u0964 \u0910\u0938\u093e \u0915\u0930\u0928\u0947 \u0938\u0947 Dropdown \u092e\u0947 \u091c\u094d\u092f\u093e\u0926\u093e Data fill \u0928\u0939\u0940\u0902 \u0915\u0930\u0928\u093e \u0939\u094b\u0924\u093e \u0939\u0948\u0902 \u0914\u0930 \u0939\u092e\u093e\u0930\u0947 \u092a\u094d\u0930\u0949\u091c\u0947\u0915\u094d\u091f \u092e\u0947 \u0915\u093f\u0938\u0940 \u092d\u0940 \u092a\u094d\u0930\u0915\u093e\u0930 \u0915\u093e Speed \u0915\u093e \u0907\u0936\u0942 \u0928\u0939\u0940\u0902 \u0906\u0924\u093e \u0939\u0948\u0902\u0964 <\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#what-is-dependent-dropdown\">What is Dependent Dropdown ?<\/a><\/li><li><a href=\"#why-need-dependent-dropdown\">Why need dependent dropdown?<\/a><\/li><li><a href=\"#how-does-dependent-dropdown-work\">How does dependent dropdown work?<\/a><\/li><li><a href=\"#video-\u0915\u0947-\u092e\u093e\u0927\u094d\u092f\u092e-\u0938\u0947-\u0938\u092e\u091d\u0928\u0947-\u0915\u0947-\u0932\u093f\u090f-\u0926\u0947\u0916\u0947\">Video \u0915\u0947 \u092e\u093e\u0927\u094d\u092f\u092e \u0938\u0947 \u0938\u092e\u091d\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0926\u0947\u0916\u0947 <\/a><\/li><li><a href=\"#google-sheet\">Google Sheet <\/a><\/li><li><a href=\"#html-code\">HTML Code <\/a><\/li><li><a href=\"#java-script-code\">JavaScript Code <\/a><\/li><li><a href=\"#google-apps-script-code-for-dependent-dropdowns\">Google Apps Script Code for Dependent Dropdowns<\/a><\/li><li><a href=\"#\u0939\u092e\u093e\u0930\u0947-\u0905\u0928\u094d\u092f-\u0906\u0930\u094d\u091f\u093f\u0915\u0932\">\u0939\u092e\u093e\u0930\u0947 \u0905\u0928\u094d\u092f \u0906\u0930\u094d\u091f\u093f\u0915\u0932<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-dependent-dropdown\">What is Dependent Dropdown ?<\/h2>\n\n\n\n<p>\u0910\u0938\u0947 Dropdown \u091c\u093f\u0938\u092e\u0947 Data \u092a\u0939\u0932\u0947 \u0938\u0947 \u0928 \u0906\u0915\u0930 \u0915\u093f\u0938\u0940 \u0913\u0930 Column \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u092a\u0930 Depend \u0939\u094b\u0924\u093e \u0939\u0948\u0902 \u092f\u093e \u0915\u0939\u0947 \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 Change \u0939\u094b\u0928\u0947 \u092a\u0930 \u0909\u0938\u092e\u0947 Value Fill \u0939\u094b\u0924\u0940 \u0939\u0948\u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-need-dependent-dropdown\">Why need dependent dropdown?<\/h2>\n\n\n\n<p>\u091c\u092c \u0915\u093f\u0938\u0940 Dropdown \u092e\u0947 \u092c\u0939\u0941\u0924 \u0939\u0940 \u091c\u094d\u092f\u093e\u0926\u093e Data \u0939\u094b\u0924\u093e \u0939\u0948\u0902 \u0924\u094b \u0939\u092e\u0947 \u0909\u0938\u092e\u0947 Search \u0915\u0930\u0928\u0947 \u092e\u0947 \u0938\u092e\u0938\u094d\u092f\u093e \u0939\u094b\u0924\u0940 \u0939\u0948\u0902, \u091c\u092c \u0939\u092e Dependent Dropdown \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0924\u094b \u0939\u092e Data \u0915\u094b Filter \u0915\u0930 \u0932\u0947\u0924\u0947 \u0939\u0948\u0902 \u091c\u093f\u0938\u0938\u0947 \u0915\u0940 data \u092a\u0939\u0932\u0947 \u0915\u0940 \u0924\u0941\u0932\u0928\u093e \u092e\u0947 \u0915\u092e \u0939\u094b \u091c\u093e\u0924\u093e \u0939\u0948\u0902 \u0914\u0930 \u0939\u092e \u0906\u0938\u093e\u0928\u0940 \u0938\u0947 Selection \u0915\u0930 \u092a\u093e\u0924\u0947 \u0939\u0948\u0902\u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-does-dependent-dropdown-work\">How does dependent dropdown work?<\/h2>\n\n\n\n<p>\u0907\u0938\u092e\u0947 \u0915\u094b\u0908 \u0939\u0940 Dropdown \u0915\u094b \u0939\u092e \u092a\u0939\u0932\u0947 \u0938\u0947 Fill \u0928\u0939\u0940\u0902 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0939\u0948\u0902, \u091c\u094b \u092d\u0940 Dropdown  \u091c\u0940 \u092d\u0940 Dropdown \u092a\u0930 depend \u0939\u094b\u0924\u0940 \u0939\u0948\u0902 \u0909\u0938\u0915\u0947 Change \u092a\u0930 Dropdown \u0915\u094b fill \u0915\u0930\u0924\u0947 \u0939\u0948\u0902, \u0906\u091c \u0915\u0947 \u0907\u0938 Article \u092e\u0947 \u0906\u092a \u0926\u0947\u0916\u0947\u0902\u0917\u0947 \u0915\u0940 \u091c\u0948\u0938\u0947 \u0939\u0940 \u0939\u092e Country Select \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0924\u092c State \u0915\u0940 Dropdown Fill \u0939\u094b \u091c\u093e\u0924\u0940 \u0939\u0948\u0902 \u0914\u0930 State Fill \u0939\u094b\u0924\u0947 \u0939\u0948\u0902 City \u0915\u0940 Dropdown Fill \u0939\u094b \u091c\u093e\u0924\u0940 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"video-\u0915\u0947-\u092e\u093e\u0927\u094d\u092f\u092e-\u0938\u0947-\u0938\u092e\u091d\u0928\u0947-\u0915\u0947-\u0932\u093f\u090f-\u0926\u0947\u0916\u0947\">Video \u0915\u0947 \u092e\u093e\u0927\u094d\u092f\u092e \u0938\u0947 \u0938\u092e\u091d\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0926\u0947\u0916\u0947 <\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\ud83d\udcf0Google Sheets Dependent Dropdowns with Apps Script Tutorial\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/wyAnzXmBGG8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u0906\u0907\u090f \u090f\u0915 Live Example \u0938\u0947 \u0938\u092e\u091d\u0924\u0947 \u0939\u0948\u0902 \u0915\u0940 Dependent Dropdown \u0915\u0948\u0938\u0947 \u0915\u093e\u092e \u0915\u0930\u0924\u0940 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"google-sheet\">Google Sheet <\/h2>\n\n\n\n<p>\u0939\u092e\u0928\u0947 \u0938\u092c\u0938\u0947 \u092a\u0939\u0932\u0947 \u090f\u0915 Google Sheet \u092c\u0928\u093e\u0908 \u0939\u0948\u0902 \u091c\u093f\u0938\u092e\u0947 \u0939\u092e\u0928\u0947 Country, State \u0914\u0930 City \u0915\u093e Data Example \u0915\u0947 \u0932\u093f\u090f Enter \u0915\u0930 \u0932\u093f\u092f\u093e \u0939\u0948\u0902 \u0964 <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"346\" src=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=640%2C346&#038;ssl=1\" alt=\"\" class=\"wp-image-11836\" style=\"width:580px;height:auto\" srcset=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=1024%2C553&amp;ssl=1 1024w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=300%2C162&amp;ssl=1 300w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=768%2C415&amp;ssl=1 768w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=60%2C31&amp;ssl=1 60w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?resize=150%2C81&amp;ssl=1 150w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-26.png?w=1251&amp;ssl=1 1251w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"html-code\">HTML Code <\/h2>\n\n\n\n<p>\u0905\u092c \u0939\u092e \u090f\u0915 Simple HTML Bootstrap page design \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902 \u091c\u093f\u0938\u092e\u0947 \u0915\u0940 \u0939\u092e\u0928\u0947 3 dropdown \u092c\u0928\u093e\u0908 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"371\" src=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-27.png?resize=640%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-11845\" style=\"width:446px;height:auto\" srcset=\"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-27.png?w=665&amp;ssl=1 665w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-27.png?resize=300%2C174&amp;ssl=1 300w, https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/image-27.png?resize=150%2C87&amp;ssl=1 150w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n\n\n<pre title=\"dropdown.html\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\n&lt;head&gt;\n  &lt;base target=\"_top\"&gt;\n\n  &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\"\n    integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\"&gt;\n  &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/js\/bootstrap.bundle.min.js\"\n    integrity=\"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn\/tWtIaxVXM\" crossorigin=\"anonymous\"&gt;\n  &lt;\/script&gt;\n\n  &lt;script src=\"https:\/\/code.jquery.com\/jquery-3.7.0.min.js\"\n    integrity=\"sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07\/g=\" crossorigin=\"anonymous\"&gt;&lt;\/script&gt;\n\n\n&lt;\/head&gt;\n\n&lt;body onload=\"getCountry();\"&gt;\n\n  &lt;div class=\"d-flex align-items-center justify-content-center \" style=\"height:400px\"&gt;\n    &lt;div class=\"border border-primary p-4 m-4 col-md-4 \"&gt;\n      &lt;div class=\"form-group \"&gt;\n        &lt;label for=\"Country\"&gt;Country &lt;\/label&gt;\n        &lt;select class=\"form-control ClsCountry\"  autocomplete=\"off\" onchange=\"getState(this.value) \"&gt;\n          &lt;option&gt;Select&lt;\/option&gt;\n        &lt;\/select&gt;\n      &lt;\/div&gt;\n\n      &lt;div class=\"form-group mt-1\"&gt;\n        &lt;label for=\"Country\"&gt;State&lt;\/label&gt;\n        &lt;select class=\"form-control ClsState\"  autocomplete=\"off\"  onchange=\"getCity(this.value) \"&gt;\n          &lt;option&gt;Select&lt;\/option&gt;\n        &lt;\/select&gt;\n      &lt;\/div&gt;\n\n      &lt;div class=\"form-group mt-1\"&gt;\n        &lt;label for=\"Country\"&gt;City&lt;\/label&gt;\n        &lt;select class=\"form-control ClsCity\" autocomplete=\"off\"&gt;\n          &lt;option&gt;Select&lt;\/option&gt;\n        &lt;\/select&gt;\n      &lt;\/div&gt;\n\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n\n\n  &lt;script&gt; \/\/Add JavaScript   &lt;\/script&gt;\n   \n\n\n\n&lt;\/body&gt;\n\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p>\u0906\u092a\u0928\u0947 \u0909\u092a\u0930\u094b\u0915\u094d\u0924 Code \u092e\u0947 \u0926\u0947\u0916\u093e \u0939\u094b\u0917\u093e \u0915\u0940 \u0939\u092e\u0928\u0947 <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1. Document load \u092a\u0930 <strong>getCountry()<\/strong> function \u0915\u094b call \u0915\u093f\u092f\u093e \u0939\u0948 <\/li>\n\n\n\n<li>2.  Country \u0915\u0947 on change \u092a\u0930 <strong>getState()<\/strong> \u0915\u094b call \u0915\u093f\u092f\u093e \u0939\u0948\u0902 <\/li>\n\n\n\n<li>3. State \u0915\u0947 on change \u092a\u0930 <strong>getCity()<\/strong> \u0915\u094b call \u0915\u093f\u092f\u093e \u0939\u0948\u0902\u0964  <\/li>\n<\/ul>\n\n\n\n<p>\u0906\u0907\u090f \u0905\u092c \u0907\u0928 \u0924\u0940\u0928\u094b\u0902 Function \u0915\u094b JavaScript \u092e\u0947 \u0938\u092e\u091d\u0924\u0947 \u0939\u0948 \u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"java-script-code\">JavaScript Code <\/h2>\n\n\n\n<p>\u092f\u0939 Javascript \u0915\u093e \u0915\u094b\u0921 \u0906\u092a HTML File \u092e\u0947 \u0932\u093f\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\"> &lt;script&gt;\n    function getCountry() {\n    google.script.run.withSuccessHandler(function(data) {\n        var Options=\"\";                              \n        $.each(data, function(key, value)            \n        {\n            Options = Options + '&lt;option&gt;' + value + '&lt;\/option&gt;';   \n        });\n        $(\".ClsCountry\").append(Options);           \n    }).getCountryList();\n  }\n\n  function getState(Country) {\n    \n    google.script.run.withSuccessHandler(function(data) {\n        var Options=\"\";                              \n        $.each(data, function(key, value)            \n        {\n            Options = Options + '&lt;option&gt;' + value + '&lt;\/option&gt;';  \n        });\n        $(\".ClsState\").empty().append('&lt;option&gt;Select State&lt;\/option&gt;');\n        $(\".ClsState\").append(Options);           \n    }).getStateList(Country);\n  }\n   \n\n  function getCity(State) {\n    \n    google.script.run.withSuccessHandler(function(data) {\n        var Options=\"\";                              \n        $.each(data, function(key, value)            \n        {\n            Options = Options + '&lt;option&gt;' + value + '&lt;\/option&gt;';   \n        });\n        $(\".ClsCity\").empty().append('&lt;option&gt;Select City&lt;\/option&gt;');\n        $(\".ClsCity\").append(Options);           \n    }).getCityList(State);\n  }\n\n  &lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u091c\u092c getCountry() Function Call \u0939\u094b\u0924\u093e \u0939\u0948\u0902 \u0924\u092c \u0939\u092e JavaScript \u0938\u0947 Apps Script \u0915\u093e <strong>getCountryList()<\/strong> Function call \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0914\u0930 \u0909\u0938\u0915\u0947 Return Data \u0915\u094b \u0939\u092e Country \u0935\u093e\u0932\u0940 Dropdown \u092a\u0930 Append \u0915\u0930 \u0926\u0947\u0924\u0947 \u0939\u0948\u0902 \u0964 <\/li>\n\n\n\n<li>\u091c\u092c \u0915\u094b\u0908 \u092d\u0940 Country Select \u0915\u0930\u0924\u093e \u0939\u0948\u0902 \u0924\u094b \u0909\u0938 Country \u0915\u0947 \u0928\u093e\u092e \u0915\u0947 \u0906\u0927\u093e\u0930 \u092a\u0930 \u0939\u092e JavaScript \u0938\u0947 Apps Script <strong>getStateList()<\/strong> function call \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0914\u0930 \u0915\u0947\u0935\u0932 Select \u0915\u0940 \u0917\u0908 Country \u0915\u0940 State \u0939\u0940 \u0932\u093e\u0924\u0947 \u0939\u0948\u0902 \u0913\u0930 State \u0915\u0940 Dropdown \u0915\u0940 empty \u0915\u0930 \u0909\u0938 \u092a\u0930 Value Append \u0915\u0930 \u0926\u0947\u0924\u0947 \u0939\u0948 \u0964 <\/li>\n\n\n\n<li>\u0909\u092a\u0930\u094b\u0915\u094d\u0924 \u091c\u094b \u092a\u094d\u0930\u094b\u0938\u0947\u0938 \u0939\u092e\u0947 Country \u0938\u0947 State \u0932\u093e\u0928\u0947 \u092e\u0947 \u0915\u0940 \u092c\u093f\u0932\u094d\u0915\u0941\u0932 \u0935\u0948\u0938\u0940 \u0939\u0940 Process \u0939\u092e State \u0938\u0947 City \u0932\u093e\u0928\u0947 \u092e\u0947 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902\u0964 \u091c\u093f\u0938\u092e\u0947 \u0939\u092e <strong>getCityList()<\/strong> Apps Script Function \u0915\u094b Call \u0915\u0930\u0924\u0947 \u0939\u0948\u0964 <\/li>\n<\/ul>\n\n\n\n<p>\u092f\u0939\u093e\u0901 \u0938\u0947 Complete \u0939\u094b\u0928\u0947 \u0915\u0947 \u092c\u093e\u0926 \u0939\u092e Apps Script Code \u0915\u094b \u0938\u092e\u091d \u0932\u0947\u0924\u0947 \u0939\u0948\u0902\u0964 <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"google-apps-script-code-for-dependent-dropdowns\">Google Apps Script Code for Dependent Dropdowns<\/h2>\n\n\n\n<p>Apps Script \u092e\u0947 \u0939\u092e \u0938\u092c\u0938\u0947 \u092a\u0939\u0932\u0947 \u0939\u092e\u0928\u0947 \u091c\u094b Google Sheet \u092c\u0928\u093e\u0908 \u0925\u0940 \u0909\u0938\u0947 Connect \u0915\u0930 \u0932\u0947\u0902\u0917\u0947\u0964 <\/p>\n\n\n\n<pre title=\"code.gs\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">let MySheets =SpreadsheetApp.getActiveSpreadsheet();\nlet CitySheet = MySheets.getSheetByName(\"city\");  \n\nfunction doGet(e) {\n  var output = HtmlService.createTemplateFromFile('dropdown');\n   \n  return output.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);\n   \n}\n\nfunction removeDuplicates(data) {\n  console.log(data);\n  newArray = [];\n  oldData=\"\";\n  data.forEach(function(value) {\n    value = value[0];\n    if (oldData != value)\n      newArray.push(value);\n    oldData = value;\n });\n return newArray;\n}\n\n\n\nfunction getCountryList() {\n  let table = CitySheet.getRange(\"A2:A\").getValues().filter(r =&gt; r.every(Boolean)); \n  table = removeDuplicates(table);\n  return table;\n}\n\n\nfunction getStateList(Country) {\n  let returnData = CitySheet.getRange(\"A:A\").createTextFinder(Country).matchEntireCell(true).findAll();\n\n    newArray = [];\n    returnData.forEach(function (range) {\n        let value = CitySheet.getRange(range.getRow(), 2).getValue();\n        newArray.push([value]);\n    });\n\n    newArray = removeDuplicates(newArray);\n    return newArray;\n}\n\nfunction getCityList(State) {\n    let returnData = CitySheet.getRange(\"B:B\").createTextFinder(State).matchEntireCell(true).findAll();\n    newArray = [];\n    returnData.forEach(function (range) {\n          let value = CitySheet.getRange(range.getRow(), 3).getValue();\n          newArray.push([value]);\n    });\n\n    newArray = removeDuplicates(newArray);\n    return newArray;\n}\n\n\n\n\n\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>removeDuplicates<\/strong>  : \u0907\u0938\u092e\u0947 \u0938\u092c\u0938\u0947 \u092a\u0939\u0932\u0947 \u0939\u092e Function \u092c\u0928\u093e\u090f\u0902\u0917\u0947 \u0924\u093e\u0915\u093f \u0939\u092e Unique value get \u0915\u0930 \u0938\u0915\u0947 Country \u0914\u0930 State \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u0915\u0940 \u092f\u0926\u093f \u0906\u092a Dropdown \u0926\u093f\u0916\u093e\u090f\u0902\u0917\u0947 \u0924\u092c \u0906\u092a\u0915\u094b \u0909\u0928\u0915\u0940 Duplicate \u0935\u0948\u0932\u094d\u092f\u0942 \u0939\u091f\u093e\u0928\u093e \u0939\u094b\u0917\u0940 <\/li>\n\n\n\n<li><strong>getCountryList :<\/strong> \u0907\u0938 Function \u0938\u0947 \u0939\u092e A:A Range \u0938\u0947 Data pick \u0915\u0930\u0947\u0902\u0917\u0947 \u0914\u0930 Duplicate Remove \u0915\u0930 return \u0915\u0930 \u0926\u0947\u0902\u0917\u0947\u0964 <\/li>\n\n\n\n<li><strong>getStateList : <\/strong>\u0907\u0938 Function \u0938\u0947 \u0939\u092e B:B Range \u0938\u0947 Data pick \u0915\u0930\u0947\u0902\u0917\u0947 \u0914\u0930 Duplicate Remove \u0915\u0930 return \u0915\u0930 \u0926\u0947\u0902\u0917\u0947\u0964 \u0938\u093e\u0925 \u092e\u0947 \u0939\u092e \u0907\u0938\u092e\u0947 \u0935\u0939\u0940 Data \u0932\u0947\u0902\u0917\u0947 \u091c\u093f\u0938\u0915\u0940 Country \u0939\u092e\u0928\u0947 \u092a\u0939\u0932\u0947 Select \u0915\u0940 \u0925\u0940 \u0964 <\/li>\n\n\n\n<li><strong>getCityList<\/strong> <strong>: <\/strong>\u0907\u0938 Function \u0938\u0947 \u0939\u092e C:C Range \u0938\u0947 Data pick \u0915\u0930\u0947\u0902\u0917\u0947 \u0914\u0930 Duplicate Remove \u0915\u0930 return \u0915\u0930 \u0926\u0947\u0902\u0917\u0947\u0964 \u0938\u093e\u0925 \u092e\u0947 \u0939\u092e \u0907\u0938\u092e\u0947 \u0935\u0939\u0940 Data \u0932\u0947\u0902\u0917\u0947 \u091c\u093f\u0938\u0915\u0940 State \u0939\u092e\u0928\u0947 \u092a\u0939\u0932\u0947 Select \u0915\u0940 \u0925\u0940 \u0964 \u0907\u0938\u092e\u0947 \u0906\u092a \u092f\u0926\u093f Duplicate Remove \u0928 \u092d\u0940 \u0915\u0930\u0947\u0902\u0917\u0947 \u0924\u094b \u0915\u094b\u0908 \u0907\u0936\u0942 \u0928\u0939\u0940\u0902 \u0939\u0948\u0902\u0964 \u0915\u094d\u092f\u0941\u0915\u0940 \u0907\u0938\u092e\u0947 Unique Value \u0939\u0940 \u0939\u094b\u0917\u0940 <\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<p>\u0906\u0936\u093e \u0939\u0948\u0902 \u092e\u0941\u091d\u0947 \u0906\u092a\u0915\u094b Dependent Dropdown \u092c\u0939\u0941\u0924 \u0939\u0940 \u0905\u091a\u094d\u091b\u0947 \u0938\u0947 \u0938\u092e\u091d \u092e\u0947 \u0906 \u0917\u092f\u093e \u0939\u0948\u0902, \u0907\u0938 Article \u0938\u0947 related \u0915\u094b\u0908 \u092d\u0940 Query \u0939\u094b \u0924\u094b \u0906\u092a \u092e\u0941\u091d\u0947 \u0928\u093f\u0903\u0938\u0902\u0915\u094b\u091a comment \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 \u092f\u0939 Article \u0915\u0948\u0938\u093e \u0932\u0917\u093e Comment \u0915\u0930\u0928\u093e \u0928 \u092d\u0942\u0932\u0947 \u0964 \u0905\u092a\u0928\u093e \u0915\u0940\u092e\u0924\u0940 \u0938\u092e\u092f \u0926\u0947\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0927\u0928\u094d\u092f\u0935\u093e\u0926 \u0964<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0939\u092e\u093e\u0930\u0947-\u0905\u0928\u094d\u092f-\u0906\u0930\u094d\u091f\u093f\u0915\u0932\"><strong>\u0939\u092e\u093e\u0930\u0947 \u0905\u0928\u094d\u092f \u0906\u0930\u094d\u091f\u093f\u0915\u0932<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-function\/\">MySQL Function<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-stored-procedure\/\">MySQL Stored Procedure<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/get-post-method\/\">PHP Get \/Post Method \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u091c\u093e\u0928\u0947<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/php-math-function\/\">PHP Math Function \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u091c\u093e\u0928\u0947<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/learn-cpp-from-c\/\">C \u0938\u0947 C ++ \u0938\u0940\u0916\u0947 \u0938\u0930\u0932 \u0936\u092c\u094d\u0926\u094b\u0902 \u092e\u0947\u0902<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/php-variables\/\">PHP Variable \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u091c\u093e\u0928\u0947<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/arduino-control-structure\/\">Arduino Control Structure<\/a>&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/c-union\/\">Union in C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/c-pointer\/\">Declaration of Pointer in C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/search-jquery\/\">jQuery Search Filter<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-table-create-alter-drop\/\">MySQL Create Table | Alter Table | Drop Table<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/api-using-node-react-express-mysql\/\">API Using NODE REACT EXPRESS MYSQL SEQUELIZE (For Backend OR Server Side)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/selfimagination.in\/tips\/cpanel\/\">CPANEL In Hindi<\/a><\/li>\n<\/ul>\n\n\n\n<script type=\"application\/ld+json\">{\n  \"@context\": \"http:\/\/schema.org\",\n  \"@type\": \"VideoObject\",\n  \"name\": \"\ud83d\udcf0Google Sheets Dependent Dropdowns with Apps Script Tutorial\",\n  \"description\": \"Google Sheets Dependent Dropdowns with Apps Script Tutorial  In this step-by-step tutorial, we'll walk you through the process of creating dependent dropdown menus in Google Sheets using Apps Script. Learn how to make your data entry forms more efficient by dynamically populating options for selecting country, state, and city based on user choices.  Read More https:\/\/selfimagination.in\/tips\/dependent-dropdowns-with-apps-script\/  #GoogleSheets #AppsScript #DependentDropdowns #GoogleScripts #DynamicDropdowns #filtered #selfimagination #hindi\",\n  \"thumbnailUrl\": \"https:\/\/i.ytimg.com\/vi\/wyAnzXmBGG8\/default.jpg\",\n  \"uploadDate\": \"2023-09-16T05:15:06Z\",\n  \"duration\": \"PT10M7S\",\n  \"embedUrl\": \"https:\/\/www.youtube.com\/embed\/wyAnzXmBGG8\",\n  \"interactionCount\": \"866\"\n}<\/script>\n","protected":false},"excerpt":{"rendered":"<p>In this step-by-step tutorial, we&#8217;ll walk you through the process of creating dependent dropdown menus in Google Sheets using Apps Script. Learn how to make your data entry forms more efficient by dynamically populating options for selecting country, state, and city based on user choices. \u091c\u092c \u092d\u0940 \u0939\u092e\u0947 \u090f\u0915 Dropdown \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u0938\u0947 \u0905\u0928\u094d\u092f \u0915\u093f\u0938\u0940 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":11843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[],"class_list":["post-11835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-apps-script"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2023\/12\/dependent-dropdown-apps-script.jpg?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/11835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/comments?post=11835"}],"version-history":[{"count":18,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/11835\/revisions"}],"predecessor-version":[{"id":11931,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/11835\/revisions\/11931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media\/11843"}],"wp:attachment":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media?parent=11835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/categories?post=11835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/tags?post=11835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}