{"id":378903,"date":"2023-04-29T03:54:16","date_gmt":"2023-04-29T03:54:16","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=378903"},"modified":"2023-05-26T05:47:23","modified_gmt":"2023-05-26T05:47:23","slug":"get-dropdown-options-dependent-dropdown-admin-ui-component","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/","title":{"rendered":"Get dropdown options from the dependent dropdown"},"content":{"rendered":"\n<p>In this blog, we are going to learn how we can get dropdown options from the dependent dropdown option in the admin form using the <a href=\"https:\/\/developer.adobe.com\/commerce\/frontend-core\/ui-components\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ui component<\/a>.<\/p>\n\n\n\n<p><strong>Here is the example we are going to achieve:-<\/strong><\/p>\n\n\n\n<p>We have two dropdowns in the custom module. 1st is for Car Maker and 2nd for the Car Model. The Car Model dropdown is dependent on the Car Maker dropdown.<\/p>\n\n\n\n<p>All options will be displayed in the Car Model dropdown on selecting the dependent Car Maker dropdown option.<\/p>\n\n\n\n<p><strong>Let&#8217;s start the code, How can achieve the same:-<\/strong><\/p>\n\n\n\n<p><strong>Step 1<\/strong>:- Create a layout file with the name mobikulcore_year_edit.xml file inside the <strong>app\/code\/Vendor\/Module\/view\/adminhtml\/layout\/<\/strong> directory.<\/p>\n\n\n\n<p>For defining the page layout and calling ui component.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;!--\n\/**\n * Module Software.\n *\n * @category  Webkul\n * @package   Webkul_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/vendor.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;..\/..\/..\/..\/..\/..\/..\/lib\/internal\/Magento\/Framework\/View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;update handle=&quot;styles&quot;\/&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;content&quot;&gt;\n            &lt;uiComponent name=&quot;mobikulcore_year_form&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p><strong>Step 2: <\/strong>Create a UI component file with the name <code>mobikulcore_year_form<\/code>.xml file inside the <strong>app\/code\/Vendor\/Module\/view\/adminhtml\/ui_component\/<\/strong> directory.<\/p>\n\n\n\n<p>For defining the dropdown fields in the UI component.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!--\n\/**\n * Module Software.\n *\n * @category  Webkul\n * @package   Webkul_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/vendor.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;form xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n        &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;provider&quot; xsi:type=&quot;string&quot;&gt;mobikulcore_year_form.year_list_data_source&lt;\/item&gt;\n            &lt;item name=&quot;deps&quot; xsi:type=&quot;string&quot;&gt;mobikulcore_year_form.year_list_data_source&lt;\/item&gt;\n        &lt;\/item&gt;\n        &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Sample Form&lt;\/item&gt;\n        &lt;item name=&quot;layout&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;type&quot; xsi:type=&quot;string&quot;&gt;tabs&lt;\/item&gt;\n        &lt;\/item&gt;\n\n        &lt;item name=&quot;buttons&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;save&quot; xsi:type=&quot;string&quot;&gt;Vendor\\Module\\Block\\Adminhtml\\Year\\Edit\\SaveButton&lt;\/item&gt;\n        &lt;\/item&gt;\n    &lt;\/argument&gt;\n\n    &lt;dataSource name=&quot;year_list_data_source&quot;&gt;\n        &lt;argument name=&quot;dataProvider&quot; xsi:type=&quot;configurableObject&quot;&gt;\n            &lt;argument name=&quot;class&quot; xsi:type=&quot;string&quot;&gt;Vendor\\Module\\Model\\Year\\DataProvider&lt;\/argument&gt;\n            &lt;argument name=&quot;name&quot; xsi:type=&quot;string&quot;&gt;year_list_data_source&lt;\/argument&gt;\n            &lt;argument name=&quot;primaryFieldName&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/argument&gt;\n            &lt;argument name=&quot;requestFieldName&quot; xsi:type=&quot;string&quot;&gt;id&lt;\/argument&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;submit_url&quot; xsi:type=&quot;url&quot; path=&quot;*\/*\/save&quot;\/&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/argument&gt;\n        &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Magento_Ui\/js\/form\/provider&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n    &lt;\/dataSource&gt;\n\n    &lt;fieldset name=&quot;year&quot;&gt;\n        &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Year&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n        &lt;field name=&quot;car_maker_id&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;options&quot; xsi:type=&quot;object&quot;&gt;Vendor\\Module\\Model\\Config\\Source\\CarMaker&lt;\/item&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;                    \n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;20&lt;\/item&gt;\n                    &lt;item name=&quot;dataType&quot; xsi:type=&quot;string&quot;&gt;text&lt;\/item&gt;\n                    &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Vendor_Module\/js\/form\/element\/CarMaker&lt;\/item&gt;\n                    &lt;item name=&quot;formElement&quot; xsi:type=&quot;string&quot;&gt;select&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Car Maker&lt;\/item&gt;\n                    &lt;item name=&quot;source&quot; xsi:type=&quot;string&quot;&gt;category&lt;\/item&gt;\n                    &lt;item name=&quot;validation&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;required-entry&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/field&gt;\n        \n        &lt;field name=&quot;model_line_id&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;options&quot; xsi:type=&quot;object&quot;&gt;Module\\Module\\Model\\Config\\Source\\ModelLine&lt;\/item&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;                    \n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;30&lt;\/item&gt;\n                    &lt;item name=&quot;dataType&quot; xsi:type=&quot;string&quot;&gt;text&lt;\/item&gt;\n                    &lt;item name=&quot;formElement&quot; xsi:type=&quot;string&quot;&gt;select&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Model&lt;\/item&gt;\n                    &lt;item name=&quot;source&quot; xsi:type=&quot;string&quot;&gt;category&lt;\/item&gt;\n                    &lt;item name=&quot;validation&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;required-entry&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/field&gt;\n    &lt;\/fieldset&gt;\n&lt;\/form&gt;<\/pre>\n\n\n\n<p><strong>Step 3<\/strong>: Create a CarMaker source file for showing all options in the car maker dropdown with the name <code>CarMaker<\/code>.php inside the <strong>app\/code\/Vendor\/Module\/Model\/Config\/Source<\/strong> directory.<\/p>\n\n\n\n<p>For displaying all the options for Car Maker dropdown.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Module Software.\n *\n * @category  Webkul\n * @package   Webkul_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/vendor.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n\nnamespace Vendor\\Module\\Model\\Config\\Source;\nuse Magento\\Framework\\Option\\ArrayInterface;\n\nclass CarMaker implements ArrayInterface\n{\n\n\n    \/**\n     * __construct\n     *\n     * @param \\Magento\\Config\\Model\\Config\\Source\\Locale\\Timezone $timezone\n     *\/\n    public function __construct(\n        \\Vendor\\Module\\Model\\ResourceModel\\CarMaker\\Collection $carMakerCollection\n    ) {\n        $this-&gt;carMakerCollection = $carMakerCollection;\n    }\n    \n    public function toOptionArray()\n        {\n            $options = &#091;];\n            foreach($this-&gt;carMakerCollection as $carMaker){\n                $option = &#091;];\n                $option&#091;&#039;value&#039;] = $carMaker-&gt;getId();\n                $option&#091;&#039;label&#039;] = $carMaker-&gt;getLabel();\n                $options&#091;]  = $option;\n\n            }\n            \n            return $options;\n        }\n}<\/pre>\n\n\n\n<p><strong>Step 4<\/strong>: Create a js component file with the name <code>CarMaker<\/code>.js file inside the <strong>app\/code\/Vendor\/Module\/view\/adminhtml\/web\/js\/form\/element\/<\/strong> directory.<\/p>\n\n\n\n<p>For the js event, get Car Model options by selecting the Car Maker dropdown.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/**\n * Module Software.\n *\n * @category  Webkul\n * @package   Webkul_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/vendor.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\ndefine(&#091;\n    &#039;jquery&#039;,\n    &#039;Magento_Ui\/js\/form\/element\/select&#039;,\n    &#039;mage\/url&#039;\n], function ($, Select,url) {\n    &#039;use strict&#039;;\n    \n    return Select.extend({\n        \n        defaults: {\n            customName: &#039;${ $.parentName }.${ $.index }_input&#039;\n        },\n        \/**\n         * Change currently selected option\n         *\n         * @param {String} id\n         *\/\n        onUpdate: function(value){\n            this.ajax(value);\n        },\n        ajax: function(value){\n            $.ajax({\n                url: window.ajaxUrl+&#039;\/mobikulcore\/year\/ajax\/&#039;,\n                showLoader: true,\n                data: {form_key: window.FORM_KEY, &#039;car_maker_id&#039;:value},\n                type: &quot;POST&quot;,\n                dataType : &#039;json&#039;,\n                success: function(result){\n                \n                    $(&#039;select&#091;name=&quot;year&#091;model_line_id]&quot;]&#039;)\n                    .find(&#039;option&#039;)\n                    .remove()\n                    .end();\n              \n                    $(&#039;select&#091;name=&quot;year&#091;model_line_id]&quot;]&#039;)\n                    .append($(&#039;&lt;option&gt;&#039;, {\n                        value: &quot;&quot;,\n                        text: &quot;Select Item&quot;\n                    })); \n\n                    result.forEach(function(item) {\n                        \n                        $(&#039;select&#091;name=&quot;year&#091;model_line_id]&quot;]&#039;)\n                        .append($(&#039;&lt;option&gt;&#039;, {\n                            value: item.entity_id,\n                            text: item.label\n                        }));        \n                    });\n                   \n                }\n            });\n        }\n    });\n});<\/pre>\n\n\n\n<p><strong>Step 5<\/strong>: Now, create a controller file for Ajax request to get the Car Model date using Car Maker with the name Ajax.php file inside the <strong>app\/code\/Vendor\/Module\/Controller\/Year\/ <\/strong>directory.<\/p>\n\n\n\n<p>For Ajax request to get all Car model options by selecting  Car Maker.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Module Software.\n *\n * @category  Webkul\n * @package   Webkul_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/vendor.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\nnamespace Vendor\\Module\\Controller\\Year;\n\nclass Ajax extends \\Magento\\Framework\\App\\Action\\Action\n{\n    protected $resultPageFactory = false;\n\n\tpublic function __construct(\n\t\t\\Magento\\Framework\\App\\Action\\Context $context,\n\t\t\\Magento\\Framework\\Controller\\Result\\JsonFactory $jsonFactory,\n\t\t\\Vendor\\Module\\Model\\ResourceModel\\ModelLine\\CollectionFactory $modelCollectionFactory,\n\t\t\\Vendor\\Module\\Model\\ResourceModel\\Year\\CollectionFactory $yearCollectionFactory,\n\t\t\\Vendor\\Module\\Model\\ResourceModel\\Modification\\CollectionFactory $modificationCollectionFactory\n\t)\n\t{\n\t\tparent::__construct($context);\n\t\t$this-&gt;jsonFactory = $jsonFactory;\n\t\t$this-&gt;modelCollectionFactory = $modelCollectionFactory;\n\t\t$this-&gt;yearCollectionFactory = $yearCollectionFactory;\n\t\t$this-&gt;modificationCollectionFactory = $modificationCollectionFactory;\n\t}\n\n\tpublic function execute()\n\t{\n\t\t$formData = $this-&gt;getRequest()-&gt;getParams(&#039;formData&#039;);\n\n\t\tif($formData&#091;&#039;type&#039;] == &quot;carMaker&quot;){\n\t\t\t$modelLine = $this-&gt;modelCollectionFactory-&gt;create();\n\t\t\t$modelLine-&gt;addFieldToFilter(&quot;car_maker_id&quot;,$formData&#091;&#039;id&#039;]); \n\t\t\t$resultJson = $this-&gt;jsonFactory-&gt;create();\n\n        return $resultJson-&gt;setData($modelLine-&gt;getData());\n\t\t}\n\t\t$resultJson = $this-&gt;jsonFactory-&gt;create();\n\n\t\treturn $resultJson-&gt;setData(&#091;]);\n\n\t\t\n\t}\n\t   \n}<\/pre>\n\n\n\n<p>Now, look into the first image in which&nbsp;<strong>Car Maker<\/strong> dropdown options are displayed in the form.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"575\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png\" alt=\"car-maker-dropdown-ss\" class=\"wp-image-378954\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-300x144.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-250x120.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-768x368.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss.png 1289w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>And in the last image in which, As you can see all options are displayed in the Car Model dropdown options mapped with the selected Car Maker.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"589\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss-1200x589.png\" alt=\"car-model-dropdown-ss\" class=\"wp-image-378955\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss-1200x589.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss-300x147.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss-250x123.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss-768x377.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-model-dropdown-ss.png 1294w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Hope this will be helpful.<\/p>\n\n\n\n<p>Thanks \ud83d\ude42<\/p>\n\n\n\n<p>You can see other blogs as well:-<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/tag\/add-custom-product-attributes\/\">Add Custom Product Attributes<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/add-a-custom-customer-group-in-magento2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Add Custom Customer Group<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how we can get dropdown options from the dependent dropdown option in the admin form using the Ui component. Here is the example we are going to achieve:- We have two dropdowns in the custom module. 1st is for Car Maker and 2nd for the Car Model. <a href=\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[14103,14102,3753],"class_list":["post-378903","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-magento-ui-component","tag-ui-compoent-form","tag-ui-component"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get dropdown options from the dependent dropdown - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get dropdown options from the dependent dropdown - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-29T03:54:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-26T05:47:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png\" \/>\n<meta name=\"author\" content=\"Mubarik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mubarik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\"},\"author\":{\"name\":\"Mubarik\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818\"},\"headline\":\"Get dropdown options from the dependent dropdown\",\"datePublished\":\"2023-04-29T03:54:16+00:00\",\"dateModified\":\"2023-05-26T05:47:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\"},\"wordCount\":355,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png\",\"keywords\":[\"Magento Ui Component\",\"Ui compoent form\",\"Ui Component\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\",\"url\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\",\"name\":\"Get dropdown options from the dependent dropdown - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png\",\"datePublished\":\"2023-04-29T03:54:16+00:00\",\"dateModified\":\"2023-05-26T05:47:23+00:00\",\"description\":\"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss.png\",\"width\":1289,\"height\":618,\"caption\":\"car-maker-dropdown-ss\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get dropdown options from the dependent dropdown\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818\",\"name\":\"Mubarik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Mubarik\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/md-mubarik459\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get dropdown options from the dependent dropdown - Webkul Blog","description":"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/","og_locale":"en_US","og_type":"article","og_title":"Get dropdown options from the dependent dropdown - Webkul Blog","og_description":"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.","og_url":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-04-29T03:54:16+00:00","article_modified_time":"2023-05-26T05:47:23+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png","type":"","width":"","height":""}],"author":"Mubarik","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Mubarik","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/"},"author":{"name":"Mubarik","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818"},"headline":"Get dropdown options from the dependent dropdown","datePublished":"2023-04-29T03:54:16+00:00","dateModified":"2023-05-26T05:47:23+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/"},"wordCount":355,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png","keywords":["Magento Ui Component","Ui compoent form","Ui Component"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/","url":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/","name":"Get dropdown options from the dependent dropdown - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss-1200x575.png","datePublished":"2023-04-29T03:54:16+00:00","dateModified":"2023-05-26T05:47:23+00:00","description":"Get dropdown options from the dependent dropdown in admin using the UI component. Get all options on selecting the parent-dependent dropdown.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/04\/car-maker-dropdown-ss.png","width":1289,"height":618,"caption":"car-maker-dropdown-ss"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/get-dropdown-options-dependent-dropdown-admin-ui-component\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Get dropdown options from the dependent dropdown"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/2fa581764e96125af674349150b2b818","name":"Mubarik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af8c0b8b43a042ae4d9fd3cb5207b18bbe898d7ab63344df28ac22803b26a0ee?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Mubarik"},"url":"https:\/\/webkul.com\/blog\/author\/md-mubarik459\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/378903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=378903"}],"version-history":[{"count":20,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/378903\/revisions"}],"predecessor-version":[{"id":383687,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/378903\/revisions\/383687"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=378903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=378903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=378903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}