{"id":1940,"date":"2021-10-29T10:56:33","date_gmt":"2021-10-29T10:56:33","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/add-customer-group-field-in-magento-2-admin-ui-component-form\/"},"modified":"2025-07-16T17:04:47","modified_gmt":"2025-07-16T11:34:47","slug":"add-customer-group-field-in-magento-2-admin-ui-component-form","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/add-customer-group-field-in-magento-2-admin-ui-component-form\/","title":{"rendered":"How to Add Customer Group Field in Magento 2 Admin UI Component Form"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The post offers a solution to&nbsp;<em><strong>add customer group field in Magento 2 admin UI component form<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the below solution when you want to implement any functionalities based on the&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/configure-customer-group-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 customer groups<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, the\u00a0Magento 2\u00a0store admin wants to offer different pricing strategies for wholesalers only and cash on delivery option should only be enabled for VIP customer groups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or \u201cinstant delivery\u201d is to be offered only to higher customer groups. Or, restrict a payment method for not logged in customer group.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To configure such rules in the admin UI, you will need to add the customer group field which can be done using the below solution:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Add Customer Group Field in Magento 2 Admin UI Component Form:<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;field name=\"coustomer_group\" sortOrder=\"40\" formElement=\"multiselect\">\n            &lt;settings>\n                &lt;label translate=\"true\">Customer Group&lt;\/label>\n            &lt;\/settings>\n            &lt;formElements>\n                &lt;multiselect>\n                    &lt;settings>\n                        &lt;options class=\"Magento\\Customer\\Model\\Customer\\Source\\GroupSourceInterface\"\/>\n                    &lt;\/settings>\n                &lt;\/multiselect>\n            &lt;\/formElements>\n  &lt;\/field><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do share the solution with the Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The post offers a solution to&nbsp;add customer group field in Magento 2 admin UI component form. Use the below solution when you want to implement&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1940","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1940"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1940\/revisions"}],"predecessor-version":[{"id":18012,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1940\/revisions\/18012"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}