{"id":58100,"date":"2023-08-31T12:52:30","date_gmt":"2023-08-31T07:22:30","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=58100"},"modified":"2023-08-31T12:52:30","modified_gmt":"2023-08-31T07:22:30","slug":"how-to-use-dependent-fields-in-drupal-9-node-entity","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/","title":{"rendered":"How to use Dependent Fields in Drupal 9 Node Entity"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list.<\/p>\n<p>In this blog, I am representing one case study of my Drupal project where I have to achieve multi-dependent fields with the help of the Dependent Fields module. So, the fields must use the widget &#8220;Select list.&#8221; The child field type must be &#8220;Entity reference.&#8221; A view with the display mode &#8220;Entity Reference&#8221; must exist and is configured to receive as the first argument the value of the parent field.<\/p>\n<h2><strong>Initial Requirements<\/strong><\/h2>\n<p>We have to install <a href=\"https:\/\/www.drupal.org\/project\/dependent_fields\" target=\"_blank\" rel=\"noopener\">Dependent Fields<\/a> module, which is a contributed module and helps us to provide options while creating a field on any entity. For add field configuration such as &#8220;Make field dependent using views&#8221; as the &#8220;Reference method&#8221; and provide parent field. You can use any entity as the parent-child relationship.<\/p>\n<p>For this example, I have created and populated two Content Types entities: Country and City &amp; one Taxonomy vocabulary: State. For the State vocabulary, I&#8217;ve created an entity reference field to link it to the correct country. For the City entity, I&#8217;ve created an entity reference field to link it to the correct state.<\/p>\n<p>Steps to follow<\/p>\n<p>1. Create the parent field by clicking on Manage \/ Content types \/ Article \/ Manage fields \/ Add field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58086\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF1-1-1024x433.png\" alt=\"Blog image\" width=\"625\" height=\"264\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1-1024x433.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1-300x127.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1-768x325.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1-1536x650.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1-624x264.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF1-1.png 1739w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>2. Configure the parent field to reference the Country Entity.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58087\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/second-1-1024x780.png\" alt=\"Blog image\" width=\"625\" height=\"476\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1-1024x780.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1-300x229.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1-768x585.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1-1536x1170.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1-624x475.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/second-1.png 1801w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>3. Save the field<\/p>\n<p>4. Create a view returning the child content filtered by the parent value (Manage \/ Structure \/ Views \/ Add view).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58088\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF3-1-1024x611.png\" alt=\"Blog image\" width=\"625\" height=\"373\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1-1024x611.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1-300x179.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1-768x458.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1-1536x917.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1-624x372.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF3-1.png 1771w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>5. Creating an &#8220;Entity Reference&#8221; view for State Listing and adding a contextual filter to point to receive the parent value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58089\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF4-1024x680.png\" alt=\"Blog image\" width=\"625\" height=\"415\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4-1024x680.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4-300x199.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4-768x510.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4-1536x1020.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4-624x415.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF4.png 1811w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>6. Click on the view format settings to configure the search option (required for entity reference display), check the appropriate search field, and also change &#8220;Pager&#8221; settings to set unlimited items; otherwise, your select list would have only 10 items as default settings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58090\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF5-1024x520.png\" alt=\"Blog image\" width=\"625\" height=\"317\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5-1024x520.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5-300x152.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5-768x390.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5-1536x779.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5-624x317.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF5.png 1805w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>7. Save the view.<\/p>\n<p>8. Go back to the Article fields configuration to create one field for the State. Click on the &#8220;Add field&#8221; and create a new entity reference field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58092\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF6-1024x497.png\" alt=\"Blog image\" width=\"625\" height=\"303\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF6-1024x497.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF6-300x146.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF6-768x372.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF6-624x303.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF6.png 1534w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>9. At the field configuration, on the &#8220;Reference Type&#8221; box, select &#8220;Make field dependent using views&#8221; as the &#8220;Reference method.&#8221; On the field &#8220;View used to select the entities,&#8221; select the &#8220;State List&#8221; view we&#8217;ve just created. On the &#8220;Parent field,&#8221; select the country field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58093\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF7-1022x1024.png\" alt=\"Blog image\" width=\"625\" height=\"626\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-1022x1024.png 1022w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-300x300.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-150x150.png 150w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-768x769.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-1533x1536.png 1533w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-624x625.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-120x120.png 120w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-24x24.png 24w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-48x48.png 48w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7-96x96.png 96w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF7.png 1771w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>10. Save the field and settings.<\/p>\n<p>11. Similarly, we will create an &#8220;Entity Reference View&#8221; for populating Cities with a State &#8220;Contextual Filter&#8221; and save the view.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58094\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF8-1024x683.png\" alt=\"Blog image\" width=\"625\" height=\"417\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8-1024x683.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8-300x200.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8-768x512.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8-1536x1025.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8-624x416.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF8.png 1809w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58095\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF9-1024x385.png\" alt=\"Blog image\" width=\"625\" height=\"235\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9-1024x385.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9-300x113.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9-768x289.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9-1536x578.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9-624x235.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF9.png 1788w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58096\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF10-1024x545.png\" alt=\"Blog image\" width=\"625\" height=\"333\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10-1024x545.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10-300x160.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10-768x409.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10-1536x818.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10-624x332.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF10.png 1674w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>12. Go back to the Article fields configuration to create one field for the City. Click on the Add field and create a new entity reference field. At the field configuration, on the &#8220;Reference Type&#8221; box, select &#8220;Make field dependent using views&#8221; as the &#8220;Reference method.&#8221; On the field &#8220;View used to select the entities,&#8221; select the &#8220;City List&#8221; view we&#8217;ve just created. On the &#8220;Parent field,&#8221; select the state field and save the field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58097\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF11-1024x958.png\" alt=\"Blog image\" width=\"625\" height=\"585\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11-1024x958.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11-300x281.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11-768x718.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11-1536x1436.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11-624x584.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF11.png 1789w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>13. Click on the &#8220;Manage form display tab&#8221; and select the &#8220;Select list&#8221; widget for the Country, State, and City fields. Save this setting.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-58098\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF12.png\" alt=\"Blog image\" width=\"1814\" height=\"271\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12.png 1814w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12-300x45.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12-1024x153.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12-768x115.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12-1536x229.png 1536w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF12-624x93.png 624w\" sizes=\"auto, (max-width: 1814px) 100vw, 1814px\" \/><\/p>\n<p>Now, when you create a new article, the State field is driven by the Country field, and the City field is driven by the State field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-58099\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF13-1024x691.png\" alt=\"Blog image\" width=\"625\" height=\"422\" srcset=\"https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF13-1024x691.png 1024w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF13-300x202.png 300w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF13-768x518.png 768w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF13-624x421.png 624w, https:\/\/tothenewco.pro\/blog\/wp-content\/uploads\/2023\/08\/DF13.png 1327w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Drupal provides the best way by installing a single contributed module, and with the help of a few configurations, we can achieve complex forms and field dependency states with other field values easily.<\/p>\n<p>Let us know in case of any queries, and please feel free to reach out via comments.<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study [&hellip;]<\/p>\n","protected":false},"author":1511,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":444,"footnotes":""},"categories":[3602],"tags":[4862],"class_list":["post-58100","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Shubham Joshi\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#article\",\"name\":\"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog\",\"headline\":\"How to use Dependent Fields in Drupal 9 Node Entity\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/shubham-joshi\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2023\\\/08\\\/DF1-1-1024x433.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#articleImage\"},\"datePublished\":\"2023-08-31T12:52:30+05:30\",\"dateModified\":\"2023-08-31T12:52:30+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#webpage\"},\"articleSection\":\"Drupal, Drupal\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"position\":2,\"name\":\"Drupal\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#listItem\",\"name\":\"How to use Dependent Fields in Drupal 9 Node Entity\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#listItem\",\"position\":3,\"name\":\"How to use Dependent Fields in Drupal 9 Node Entity\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/drupal\\\/#listItem\",\"name\":\"Drupal\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/shubham-joshi\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/shubham-joshi\\\/\",\"name\":\"Shubham Joshi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/49641092-4f45-4aba-844e-c89c19be46b4_5790-Shubham-Joshi-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Shubham Joshi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/\",\"name\":\"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog\",\"description\":\"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/how-to-use-dependent-fields-in-drupal-9-node-entity\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/shubham-joshi\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/shubham-joshi\\\/#author\"},\"datePublished\":\"2023-08-31T12:52:30+05:30\",\"dateModified\":\"2023-08-31T12:52:30+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog","description":"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study","canonical_url":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#article","name":"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog","headline":"How to use Dependent Fields in Drupal 9 Node Entity","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/shubham-joshi\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/DF1-1-1024x433.png","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#articleImage"},"datePublished":"2023-08-31T12:52:30+05:30","dateModified":"2023-08-31T12:52:30+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#webpage"},"articleSection":"Drupal, Drupal"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/drupal\/#listItem","name":"Drupal"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/drupal\/#listItem","position":2,"name":"Drupal","item":"https:\/\/tothenewco.pro\/blog\/category\/drupal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#listItem","name":"How to use Dependent Fields in Drupal 9 Node Entity"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#listItem","position":3,"name":"How to use Dependent Fields in Drupal 9 Node Entity","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/drupal\/#listItem","name":"Drupal"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/shubham-joshi\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/shubham-joshi\/","name":"Shubham Joshi","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/49641092-4f45-4aba-844e-c89c19be46b4_5790-Shubham-Joshi-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Shubham Joshi"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/","name":"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog","description":"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/shubham-joshi\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/shubham-joshi\/#author"},"datePublished":"2023-08-31T12:52:30+05:30","dateModified":"2023-08-31T12:52:30+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog","og:description":"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study","og:url":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"How to use Dependent Fields in Drupal 9 Node Entity | TO THE NEW Blog","twitter:description":"Introduction When working with complex forms, you often have fields whose state depends on the input values of other fields in the form. For example, you might have a select list of options, the options for which depend upon the value selected for another select list. In this blog, I am representing one case study","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"58100","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"#aioseo-article-65e05cd8b96d4","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2023-08-31 06:45:52","updated":"2024-02-29 10:30:48","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/drupal\/\" title=\"Drupal\">Drupal<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to use Dependent Fields in Drupal 9 Node Entity\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Drupal","link":"https:\/\/tothenewco.pro\/blog\/category\/drupal\/"},{"label":"How to use Dependent Fields in Drupal 9 Node Entity","link":"https:\/\/tothenewco.pro\/blog\/how-to-use-dependent-fields-in-drupal-9-node-entity\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/58100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/1511"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=58100"}],"version-history":[{"count":5,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/58100\/revisions"}],"predecessor-version":[{"id":58219,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/58100\/revisions\/58219"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=58100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=58100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=58100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}