cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in implementing import functionality in custom module

SOLVED

Issue in implementing import functionality in custom module

Hello @Manthan Dave,

I am facing this error when clicking on Check Data Button, when importing csv file.

 

Import   Import Export   Data Transfer   System   Magento Admin.png

Certified Magento 2 Developer
Vivek Singh
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Issue in implementing import functionality in custom module

Hello @Vivek Singh

 

For implementing import functionality in custom module you have to create import.xml file at app/code/Vendorname/Modulename/etc/import.xml. I think there is some mistake in your import.xml file. Please make sure all the things are correct.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
    <entity name="custom_import" label="Custom Import" model="Vendorname\Modulename\Model\Import\CustomImport" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" />
</config>

The entry import.xml will add a new option in the import page "Entity Type" dropdown (System > Data Transfer > Import)

now in the import.xml the xml attributes:

behaviorModel: Takes the class name of the model class responsible to handle the logic for the import

label: Label name of the dropdown option

name: name for the dropdown option value

import page "Entity Type" dropdown

 

You can follow the following steps shown in below link. Hope it will definetely help you.

https://bsscommerce.com/confluence/how-to-import-csv-file-to-custom-table-magento2/

 

Problem solved? Click Kudos & Accept as Solution!

Magento Developer
Ankita Biswas

View solution in original post

3 REPLIES 3

Re: Issue in implementing import functionality in custom module

Hi @Vivek Singh

 

Not sure why , but your screenshot is not visible to us - could you please check again ? or post exact error log over here , which you are facing ?

 

so its help us to troubleshoot the issue !

if issue solved,Click Kudos & Accept as Solution

Re: Issue in implementing import functionality in custom module

Hello @Manthan Dave,

Again i have uploaded screenshot of my image but what the problem, image is not showing.

Certified Magento 2 Developer
Vivek Singh

Re: Issue in implementing import functionality in custom module

Hello @Vivek Singh

 

For implementing import functionality in custom module you have to create import.xml file at app/code/Vendorname/Modulename/etc/import.xml. I think there is some mistake in your import.xml file. Please make sure all the things are correct.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
    <entity name="custom_import" label="Custom Import" model="Vendorname\Modulename\Model\Import\CustomImport" behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" />
</config>

The entry import.xml will add a new option in the import page "Entity Type" dropdown (System > Data Transfer > Import)

now in the import.xml the xml attributes:

behaviorModel: Takes the class name of the model class responsible to handle the logic for the import

label: Label name of the dropdown option

name: name for the dropdown option value

import page "Entity Type" dropdown

 

You can follow the following steps shown in below link. Hope it will definetely help you.

https://bsscommerce.com/confluence/how-to-import-csv-file-to-custom-table-magento2/

 

Problem solved? Click Kudos & Accept as Solution!

Magento Developer
Ankita Biswas