🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Add Customer Group Field in Magento 2 Admin UI Component Form

By Sanjay JethvaUpdated on May 22, 2025 1 min read

The post offers a solution to add customer group field in Magento 2 admin UI component form.

Use the below solution when you want to implement any functionalities based on the Magento 2 customer groups.

For instance, the Magento 2 store admin wants to offer different pricing strategies for wholesalers only and cash on delivery option should only be enabled for VIP customer groups.

Or “instant delivery” is to be offered only to higher customer groups. Or, restrict a payment method for not logged in customer group.

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:

Method to Add Customer Group Field in Magento 2 Admin UI Component Form:

<field name="coustomer_group" sortOrder="40" formElement="multiselect">
            <settings>
                <label translate="true">Customer Group</label>
            </settings>
            <formElements>
                <multiselect>
                    <settings>
                        <options class="Magento\Customer\Model\Customer\Source\GroupSourceInterface"/>
                    </settings>
                </multiselect>
            </formElements>
  </field>

That’s it.

Also, do share the solution with the Magento Community via social media.

Thank you.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.