How to Modify Attribute Values During Import and Export in Magento 2

Magento 2 attributes, values, and attribute sets import and export

The following article describes how to modify attribute values during the import & export processes. Below, we not only shed light on the corresponding features but also provide several ways to simplify the appropriate procedures as much as possible. Let’s take a look at the details.

Modify Attribute Values for Import and Export Processes in Magento 2

It is not a secret that Magento 2 doesn’t let you import/export attributes, but you can quickly get the missing functionality by installing the Improved Import & Export Magento 2 extension. The module enables import of attributes, attribute sets, and attribute values via CSV, XML, JSON, ODS, and Excel files. The same is about export procedures.

In addition to the plane import/export processes, the module lets you modify attribute values making them more suitable for your e-commerce needs. And it is not mapping: attribute values modification is an entirely different procedure that dramatically extends the plugin’s existing attribute import/export flexibility.

For instance, the attribute value you’d like to change is “red”. You want to change it to “dark-red” for all products. The Improved Import & Export Magento 2 extension lets you create a rule that adds “dark” to all “red” attribute values. Thus, you can change the attribute value for thousands of products within just a few clicks.

Multiple rule combinations can be created using the selection of various rules. You can modify attribute values in Magento 2 in the following way:

  • Affixation – add a prefix, suffix to SKU and other attributes. Specify conditions to attach text to the beginning and end of a value.
  • Data Split – split data from one block to multiple blocks of different products;
  • Data Merge – combine data from various blocks in one if necessary;
  • RegEx – Manipulate the values in the source file using RegEx.

Pros

What are the positive aspects of this feature?

  • You don’t need to spend weeks changing attribute values manually.
  • It is possible to avoid multiple mistakes caused by manual editing.
  • You do everything within an intuitive interface.

Cons

What about the drawbacks?

If installing a third-party extension is a drawback for you than you know one. If not, we don’t know what to discuss here.

Alternative Approach

As mentioned above, you can always change attributes manually as an alternative approach to the one described above, but get ready to waste tons of time and face mistakes caused by the human factor multiplied by the dull repetitive routine. Thus, we recommend you to use the Improved Import & Export Extension instead.

Get Improved Import & Export Magento 2 Extension

Improved Attribute Import/Export Functionality

Magento 2 mysql data import

Now, let’s take a look at core features related to the import/export of attributes, attribute sets, and attribute values provided by the Improved Import & Export Magento 2 extension. The module lets you create the following things when you import attribute data:

  • Attribute groups, set names, and multiple sets;
  • Attribute labels using a store view as a basis;
  • Attribute options utilizing a store view as a basis;
  • New attributes on the fly.

As for the update functionality of the Improved Import & Export Magento 2 module, it allows refresh data for:

  • Attribute labels using a store view as a basis;
  • Attribute option values utilizing a store view as a basis.

And don’t forget about the corresponding export options. You can even leverage export processes by specific attribute sets. Let’s proceed to other features since there are many more exciting options we’d like to draw your attention to.

Create attributes on the fly

First of all, it is necessary to say a few more words about the ability to create attributes on the fly during import. The feature is based on the ability to replace a standard attribute name in an attributes column with all data necessary to create an attribute there. Thus, you should specify an attribute set, frontend labels, scopes, and multiple other parameters there to create new attributes on the fly during the update. The general format of an attribute creation column looks as follows:

As you can see, a pipe symbol – “|” – is used for separating values. ALWAYS start the new attribute column with ‘attribute’ to help the Improved Import & Export extension understand that it should deal with a new attribute. The column name with the new attribute may have the following appearance:

For further information, proceed to the official manual of the Improved Import & Export extension here: Product attributes import. You will find out how to compose a new attribute and see the attribute value reference table explained.

Attribute import & export file formats

The Improved Import & Export Magento 2 extension extends the default support for file formats. While Magento relies on CSV as its core data transfer standard and multiple third-party extensions add XML to the game, our plugin does a much better job. In addition to CSV and XML, the Improved Import & Export Magento 2 module allows importing attributes via JSON, ODS, and Excel files. The same is about export processes. You can freely leverage the same standards for transferring data between your e-commerce store and external systems.

And there is no need to convert XML, JSON, ODS, or Excel files to CSV to import attributes or other entities to your store. At the same time, you can create output that is more suitable for the needs of an external platform by exporting attributes or other data via one of the formats mentioned above. 

Attribute import & export file sources

In addition to the supported file formats, we should say a few words about file sources the Improved Import & Export Magento 2 extension works with. The module allows transferring attributes via data files using such destinations as:

  • FTP/SFTP. This file source provides two options. First of all, you can import/export attribute data files from/to your local server. Of course, this option is not suitable for all integration so that we’ve decided to extend it with the support for remote servers. Use one to transfer data between your e-commerce store and an external platform.
  • Dropbox. A Dropbox account can be leveraged for the same purposes as well. Freely transfer attributes, attribute sets, and attribute values between two systems using it.
  • URL. Direct URL uploads are another essential feature of the extension. You can import attribute data via a direct link.

Note that all compressed data is extracted automatically during the import procedure.

Attribute import & export without files

There are several more ways to import/export attribute data avoiding file transfers. First of all, you can import attributes, attribute sets, and attribute values from Google Sheets. The example of the Google Sheets data import looks as follows:

Magento 2 Google Sheet import

Another way to avoid files is represented with the SOAP API, REST API, and GraphQL API integrations. The Improved Import & Export Magento 2 extension lets you create a connection between your Magento 2 store and an external system using one of these standards.  

Advanced Usability

Below, you will find core usability improvements of the extension. We describe two important aspects of the Improved Import & Export Magento 2 extension: Mapping and Scheduling. Let’s take a look at the first one.

Mapping

Unfortunately, you cannot just take attributes of one system and move them to Magento 2. Since different platforms use different data standards, the direct connection is impossible. However, you can solve the problem in two ways.

The default solution is based on manual data file editing. You have to spend hours modifying attributes of the external system to make them suitable for the requirements of Magento 2. You not only spend lots of time but can also make mistakes since this routine requires extra concentration. Thus, it is necessary to spend even more time looking for errors. And don’t forget that the number of product attributes may be vast so that you’ll need weeks to edit all of them and weeks to find possible mistakes.

Luckily, there is a more efficient solution represented in the Improved Import & Export Magento 2 extension. With the module’s convenient mapping interface, you can match any third-party attributes to Magento 2 attributes without headaches. A user-friendly tool is available right in the Magento admin so that you don’t need to edit data files manually.

It is also worth mentioning that the necessity to repeat data files editing is eliminated. The Improved Import & Export Magento 2 module lets you create individual mapping schemes that serve corresponding integrations during further updates.

And this is how attributes are matched in case of the Improved Import & Export Magento 2 extension:

But we have to point you to another usability improvement. To simplify attribute matching, we’ve created mapping presets – predefined mapping schemes that eliminate the necessity to create any custom matches. Just select a scheme suitable for your business needs, and the Improved Import & Export extension will do everything for you just like in the following example:

Please, contact our support regarding mapping presets for your specific business case. Leave your requests here: Firebear Help Center.

Schedules

Usually, you don’t need to import/export attributes regularly so that scheduling is not necessary for this type of data transfers, but you can leverage it in case of other updates. With the Improved Import & Export extension, you can create any custom schedule since the module supports cron updates. Neither the default Magento tools nor most third-party extensions let you automate the process of import/export so that it is a substantial competitive advantage of our module as well as an essential usability improvement.

You can create any custom schedule via the standard cron syntax. Configure update time that is most suitable for your e-commerce needs. If you don’t want to deal with customizations, feel free to select one of the predefined intervals. The Improved Import & Export Magento 2 module lets you customize them if necessary.

At the same time, you can create jobs suitable for a manual run only. They are especially useful for importing/exporting attributes, attribute sets, and attribute values or other infrequent updates. It is also necessary to mention that you can launch any update manually in an asynchronous mode. If an import process is scheduled for Friday, but it is Monday now, and the update is crucial, you don’t need to create a new import job – launch the existing one asynchronously. Below, you can see how to configure a schedule of updates:

Note that all usability improvements are fully compatible with all entities, file formats, file sources, and alternative ways of import/export. More features of the Improved Import & Export extension are described here:

Conclusions

The Improved Import & Export extension dramatically extends the default opportunities introduced in Magento 2. Furthermore, the module provides features that are not offered by most competitors. And the ability to import/export attributes and edit their values is one of them. For any further information about the module, follow this link:

Get Improved Import & Export Magento 2 Extension