Skip to content

Magento2.3.5: How to get Customer Grid custom columns values in CSV?

I want to to add custom columns values in export option in customer grid, but only heading are showing in csv file not values.

here is my customer grid custom columns.

VendorModule/view/adminhtml/ui_component/customer_listing.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">
        <column name="loyal_member_since" class="VendorModuleUiComponentListingColumnLoyalMemberSince">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Loyal Member Since</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>date</dataType>
            </settings>
        </column>
        <column name="loyalty_tier" class="VendorModuleUiComponentListingColumnTier">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Tier</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="loyalty_welcome" class="VendorModuleUiComponentListingColumnWelcome">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Welcome</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="devices_registered" class="VendorModuleUiComponentListingColumnDeviceRegistration">
            <settings>
                <filter>number</filter>
                <label translate="true">Device registration</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="new_neo_subscription" class="VendorModuleUiComponentListingColumnNewNeoSubscription">
            <settings>
                <filter>boolean</filter>
                <label translate="true">New neo subscription</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="loyalty_happy_birthday" class="VendorModuleUiComponentListingColumnHappyBirthday">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Happy birthday</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="loyalty_purchases" class="VendorModuleUiComponentListingColumnPurchasesId">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Purchases</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="premium_accessories" class="VendorModuleUiComponentListingColumnPremiumAccessories">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Premium accessories</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="free_device" class="VendorModuleUiComponentListingColumnFreeDevice">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Free device</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="warranty_extension" class="VendorModuleUiComponentListingColumnWarrantyExtension">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Warranty extension</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="redeemed_points" class="VendorModuleUiComponentListingColumnRedeemPoints">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Redeem points</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="unsubscription_date" class="VendorModuleUiComponentListingColumnUnsubscription">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Unsubscription</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>date</dataType>
            </settings>
        </column>
        <column name="deals_redeemed" class="VendorModuleUiComponentListingColumnDeals">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Deals</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
    </columns>
</listing>

but when i export csv this is what i get
enter image description here
enter image description here

i only get default columns values but custom columns just heading no values

  • any idea how to do this?