CSV files generated from my Shopify app

Hi everyone,

I’ve run into a formatting issue with CSV files generated from my Shopify app, and I’m hoping someone has run into this before or knows the best practice to handle it.

Here’s what’s happening:

The CSV file is generated programmatically from my app (Node.js backend).

On Windows, when opened with Excel or any CSV viewer, the file displays perfectly — all columns, including the Variant GID column, show correct string values like:

gid://shopify/ProductVariant/123456789
However, on Mac, when opening the same CSV in Numbers, the app automatically interprets the Variant GID column as a numeric field.

It removes quotes and/or converts the value into scientific notation (e.g., 1.23457E+11),

resulting in incorrect or truncated GID values.

This breaks the data integrity when the merchant tries to re-upload or process the CSV.

What I’ve Tried

Wrapping the GID values in quotes (“gid://shopify/ProductVariant/123456789”).

Escaping special characters and ensuring UTF-8 encoding.

Adding a prefix (like =‘gid://…’), but that causes issues when re-importing or parsing back in Node.js.

Question

What’s the best practice or reliable workaround to ensure CSV files maintain consistent formatting across Windows (Excel) and Mac (Numbers) — specifically so Shopify GID values remain as text and are not auto-converted to numbers or scientific notation?

Any recommendations or known strategies used in other Shopify apps would be very helpful.

1 Like

Hey @Shrutika_Lokhande, as far as I know each application (Excel, Numbers, Google Sheets) decides how to interpret the data when opening it, so there may not be much that can be done when merchants are using Numbers.

I would recommend suggesting Google Sheets to your merchants. This is an approach we have taken in our CSV documentation.

For a possible workaround, since you can’t control how merchants open the file, would it work to add a cleanup tool in your app that detects and repairs corrupted GIDs when they re-upload.