<p>The solution at <a href="https://github.com/craftcms/feed-me/issues/368#issuecomment-555710613" rel="nofollow noreferrer">https://github.com/craftcms/feed-me/issues/368#issuecomment-555710613</a> works just fine.</p>

<p>(Mentioning this in the docs would be good :)</p>

<p>I didn't bother with step 7 as it seems the first line automatically becomes the default variant if one isn't set.</p>

<p><em>1. Create a new custom field e.g. "Import ID" and add it to the product type that has variants<br>
2. Create new line for each product variant.<br>
3. Make sure "Import ID" is the same for variants of the same product (But unique for each product).<br>
4. Under "Import Strategy" of Feed Me check both: "Create new elements" and "Update existing elements".<br>
5. Under "Set a unique identifier to match against existing elements" check the field you created in step 1: eg. "Import ID".<br>
6. Map all other fields as you would normally do with a non-variant import.<br>
7. Make sure you have an extra column for the "Is Default" field and that only one of the variants has that value to set to 1</em></p>

CC BY-SA 4.0
2020-03-03T14:40:45.263Z
2020-03-04T10:58:11.583Z
2020-03-04T10:58:11.583Z
James Greig
<p>Is there a way to automagically create variants from a Google Sheet when importing via Feed Me?</p>

<p>The docs at <a href="https://docs.craftcms.com/feed-me/v4/guides/importing-commerce-variants.html#setup-your-feed" rel="nofollow noreferrer">https://docs.craftcms.com/feed-me/v4/guides/importing-commerce-variants.html#setup-your-feed</a> only mention JSON and XML</p>

<p>Thanks :) </p>

<p>EDIT FOR CLARITY: I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure...</p>

CC BY-SA 4.0
2020-03-02T16:01:35.390Z
fwiw those pages under **Guides** all mention just _XML or JSON_, but according to [this page](https://docs.craftcms.com/feed-me/v4/feature-tour/creating-your-feed.html#feed-type) of the docs you should be able to use Google Sheets, and I would imagine for any of the content types they have specific guides on. ¯\\_(ツ)_/¯
Jalen Davenport
CC BY-SA 4.0
2020-03-02T16:36:18.667Z
Thanks @JalenDavenport - I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure...
James Greig
<plugin-craftcommerce><plugin-feedme>
Feed Me - importing Commerce variants from Google Sheets?
# Feed Me - importing Commerce variants from Google Sheets?

(Asked by: username_0 on 2020-03-02)

Is there a way to automagically create variants from a Google Sheet when importing via Feed Me?

The docs at <https://docs.craftcms.com/feed-me/v4/guides/importing-commerce-variants.html#setup-your-feed> only mention JSON and XML

Thanks :)

EDIT FOR CLARITY: I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure...

**Tags:** plugin-craftcommerce, plugin-feedme

> **Comments:**
> **username_1**: fwiw those pages under **Guides** all mention just _XML or JSON_, but according to [this page](https://docs.craftcms.com/feed-me/v4/feature-tour/creating-your-feed.html#feed-type) of the docs you should be able to use Google Sheets, and I would imagine for any of the content types they have specific guides on. ¯\\_(ツ)_/¯  
> **username_0**: Thanks @JalenDavenport - I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure...  

---

## 1 answers

### Answer by username_0 on 2020-03-03. Score: 1 | Accepted answer

The solution at <https://github.com/craftcms/feed-me/issues/368#issuecomment-555710613> works just fine.

(Mentioning this in the docs would be good :)

I didn't bother with step 7 as it seems the first line automatically becomes the default variant if one isn't set.

*1. Create a new custom field e.g. "Import ID" and add it to the product type that has variants  
2. Create new line for each product variant.  
3. Make sure "Import ID" is the same for variants of the same product (But unique for each product).  
4. Under "Import Strategy" of Feed Me check both: "Create new elements" and "Update existing elements".  
5. Under "Set a unique identifier to match against existing elements" check the field you created in step 1: eg. "Import ID".  
6. Map all other fields as you would normally do with a non-variant import.  
7. Make sure you have an extra column for the "Is Default" field and that only one of the variants has that value to set to 1*


---

