Start Free Trial
Start Free Trial

Do not update Metafields that are cut off at 32767 characters when edited in Excel

Metafield

The problem

Microsoft Excel has some limitations that can sometimes cause trouble when working with large amounts of data. One of those limitations is 32767 character limit for a single cell.

Multiple other apps use Metafields to store various information and it can get quite large over time. If some Metafield value is over this Excel limit of 32767 characters, then it will still be all exported, but when opening the file in Excel it will first display error:

"We found a problem with some content in 'Export_2019-06-18_1659.xlsx'. Do you want us to try to recover as much as we can?".

When Excel has recovered the data it will cut all cell values over the limit to 32767 characters. Saving this file and importing back into the Shopify will result in the Metafield being saved with these 32767 characters, thus cutting the rest off information in that cell.

Note that it will cut it off only if you open the exported .xlsx or .csv file in Excel, and save it. If you will not save the file, and import it by just exporting, then nothing will be cut off – you will be all good.

Solution

We have made the Matrixify app to locate this possible issue and not update any Metafields whose values are exactly 32767 characters (the cut-off cell size).

If the cell value is over 32767 Characters that means that Excel has not cut it and it’s good to import.
If the cell value is under 32767 Characters that again means that Excel has not forcefully cut anything and Metafield will bet set/updated as usually.

Once the Matrixify will detect Metafield with this exact length it will not fail the item, but in the Import Results file a warning will be returned:

"Warning: [Metafield: namespace.key [type]] is not saved. It may be cut off by the Excel because of the 32767 character limit."

What to do next?