---
title: "Magento 2 : How to Add New Column In The Customer Grid"
url: "https://magecomp.com/blog/magento-2-add-new-column-customer-grid/"
date: "2020-03-20T19:11:10+00:00"
modified: "2025-02-21T11:14:27+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 675
reading_time: "4 min read"
summary: "Hello Magento Folks,"
description: "In this Magento How to Series blog, We have added how to add a new/custom table in the customer grid in Magento 2 with complete code guideline."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Create Coupon Codes Programmatically in Magento 2"
    url: "https://magecomp.com/blog/how-to-create-coupon-codes-programmatically-in-magento-2/"
  - title: "How to Implement Multiselect Filter for Order Status in Magento 2 Order Grid"
    url: "https://magecomp.com/blog/how-to-implement-multiselect-filter-for-order-status-in-magento-2-order-grid/"
  - title: "How to install SUPEE 6788 with or without SSH?"
    url: "https://magecomp.com/blog/how-to-install-supee-6788-with-or-without-ssh/"
---

# Magento 2 : How to Add New Column In The Customer Grid

_Published: March 20, 2020_  
_Author: Dhiren Vasoya_  

![How to Add New Column in Customer Grid in Magento 2](https://magecomp.com/blog/wp-content/uploads/2020/03/How-to-Add-New-Column-in-Customer-Grid-in-Magento-2-1024x512.webp)

Hello Magento Folks,

Hope you are all doing well, I am back with another interesting article on Magento 2 How to Series.

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-1.webp)](https://magecomp.com/services/hyva-theme-development/)

Last time we learned about [**How to Create a Custom Table via XML In Magento 2.3**](https://magecomp.com/blog/how-to-create-custom-table-via-xml-in-magento-2/). So today, We are going to learn How to add a new Column in the Customer Grid in Magento 2.

**Introduction**

Many times we have the requirement to add a custom / new column to the customer grid. So in this blog, We will help you to achieve your requirement. We are going to learn How to add a new column in the customer grid in Magento 2. I believe that you all know very well how to create a simple module, therefore we will start by following the given below steps for adding a new/custom table in the customer grid in Magento 2.

**Importance of Customer Grid**

In the importance of the customer grid, we can say that during the online shopping the customers register on your online shop of Magento 2, there is a mandatory to fill some fields, for example, email, mobile number, first name, last name. If a customer desires to provide some extra information. For this intention, we need to add some of the extra fields in the registration form.

In this blog, we will include how to add a new/custom table in the customer grid in Magento 2, I will explain to you how to perform and how actually it works.

**Let’s Get Started with How to Configure:**

Note: Customer grid gets data for listing and filtering from customer_grid_flat table.

**Step 1 : For performing this, create customer_listing.xml file inside app\code\Vendor\Extension\view\adminhtml\ui_component**

```
<?xml version="1.0" encoding="UTF-8"?>
<columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">

<column name="custom_column" sortOrder="90" class="VendorExtensionUiComponentListingColumnCustomColumn">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="sortable" xsi:type="boolean">true</item>
<item name="filter" xsi:type="string">text</item>
<item name="dataType" xsi:type="string">text</item>
<item name="align" xsi:type="string">left</item>
<item name="label" xsi:type="string" translate="true">Team</item>
</item>
</argument>
</column>
</columns>
```

Here, we are using the rendered to customize column value, so for achieving that we will need to follow the below-given steps,

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-1.webp)](https://magecomp.com/services/magento-upgrade-services/)

**Step 2: Next, create CustomColumn.php file inside**

**app\code\Vendor\Extension\Ui\Component\Listing\Column\ folder and add the given below code to it:**

```
<?php

namespace VendorExtensionUiComponentListingColumn;

use MagentoFrameworkViewElementUiComponentContextInterface;
use MagentoFrameworkViewElementUiComponentFactory;
use MagentoUiComponentListingColumnsColumn;
use MagentoFrameworkApiSearchCriteriaBuilder;

class CustomColumn extends Column
{
protected $customerFactory;
protected $_searchCriteria;

public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
SearchCriteriaBuilder $criteria,
array $components = [], array $data = [])
{
$this->_searchCriteria = $criteria;
parent::__construct($context, $uiComponentFactory, $components, $data);
}

public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {

foreach ($dataSource['data']['items'] as & $item) {
$item[$this->getData('name')] = “admin - “ . $this->getData('name');

}
}
return $dataSource;
}
}
```

Therefore, the above given easy steps will definitely help you to add the new/custom column at the customer grid in Magento 2.

**Conclusion**

Now, there is no need for following complex ways to waste your time. Follow the above given easy steps and make your Magento 2 store better.

That’s it for the day, I believe that all of you can execute the above-given steps without facing any type of difficulty. In case you have any difficulty you face, kindly let us know your question in the comment section below. If you find these resources helpful don’t forget to share with your Magento pals.

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-1.webp)](https://magecomp.com/magento-performance-optimization.html)

Happy Coding?


---

_View the original post at: [https://magecomp.com/blog/magento-2-add-new-column-customer-grid/](https://magecomp.com/blog/magento-2-add-new-column-customer-grid/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-26 09:05:16 UTC_  
