How do I export metafields to a CSV file?

Modified on Sun, 30 Jul 2023 at 04:46 PM



In this tutorial, you will learn about data exports and their real-world applications. 

The most common use cases include, but are not limited to:

1) exporting data from one Shopify store to have it imported to another Shopify store;

2) exporting data to a CSV file to have it edited in a spreadsheet editor and imported back to update the data;

3) generating template files for future data import tasks;

4) creating a backup copy of existing metafields.

Accessing the data export menu

Go to the Apps section of your Shopify admin panel (1) and select our app from the list of installed apps (2):

Next, navigate to the Bulk Actions tab of our menu (3) and go to Export (4):

Data filtering system

The resource selector is the first element you'd usually interact with. The default value is set to Products as this resource type is the most popular among our users, but you can click on it and reveal more options to choose from:

Next, there's the filtering area, where you can switch between the simple and advanced modes. By default, the simple mode is active, but you can switch to the advanced mode by pressing this button:

When in the simple mode, you can select items from the grid (it supports pagination and you can also sort items to your convenience) with your mouse (1), use the search bar to find the items to edit (2), use saved searches (3), and reveal the menu for additional filters (4):

Here's an example showing the results of multiple filters combined:

If your task requires even more precise filtering, you can build your very own configurable queries using the use advanced filter.

Press the Use advanced filter button we discussed earlier to switch the editor mode. Next, press the Add new filter button to create a filter:

Each filter condition consists of three main components: the field/property to filter by (1), the condition type (2), and the value (3):

Multiple conditions can be applied to a single filter. The conditions can be joined with "AND" or "OR" logical operators, for the filter to match ALL and ANY of the conditions respectfully. To add another condition to your filter, click on the Add new condition button (1) and configure the additional condition:

In addition to this, you can combine multiple filters. To add another filter for the same bulk action, press the Add new filter button (1), select the connection type (filters can be joined with "AND" or "OR") (2), and configure conditions (3):

You can preview the results by pressing the Show filtered products (or another resource type) button:

When you are done with the configuration, press the Export metafields for filtered products (or another resource type) button to proceed to the next step.

Configuring a data export task

Selecting the CSV file format

Before you proceed with a further configuration, you can select the preferred format for the future export file:

Some merchants prefer to manage spreadsheets via editors like Excel, Numbers, or Google Sheets, while others might tend to automate the process with custom tools. Hence, our app supports two different layouts of CSV files:
1) human-friendly "columns";
2) automation-focused "rows" that allow for better data integrity.
The main difference is that when metafields are exported as "columns", each resource (product, collection, etc.) is represented by a single row with separate columns for each metafield, whereas, when exported as "rows" - each metafield is represented by an individual row that contains both the metafield and the parent resource data.

Here you can see the difference the format makes for 30 metafield records:

1) The rows format

2) The columns format

Selecting the data to be exported

Metafields to be exported

If you want to have all metafields exported to a CSV file, you should not apply additional filters. However, if you want only specific metafields to be exported, there are multiple options to make it happen. You can either specify the list of namespace/key combinations to be exported (1) or export all metafields that belong to a certain namespace (2):

Adding standard Shopify attributes to the export file

You can also select from a wide range of standard Shopify attributes to be included in the export file. Yet another great thing is that you can include the first variant data when exporting product-level metafields:

Additional options

Export empty metafields

Use this option to have empty/non-existent metafields represented by placeholder records in the export file. Useful for creating template files or reports on specific metafields.

Export with user-friendly values

Use this option to add an extra column with values converted into a human-readable format. Especially useful for complex metafield types like references, lists, etc.

Important note: this column can't be used for imports. You may want to use the standard value column instead.

Downloading the results

To download the CSV file with your data, navigate to the History tab, find the export task you created earlier, and click on the Results button next to it:

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article