# Adding Shopify orders to Google Sheet data source

**URL:** <https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141>\
**Category:** Ask for Help\
**Created:** [May 19, 2022, 6:02am UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141 "2022-05-19T06:02:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 19, 2022, 6:02am UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/1 "2022-05-19T06:02:22Z")

</div>

I see that Shopify Flow can be used to automate workflows.

I want to set up the following workflow:

1. New order of product A
2. Shopify adds new row to Google Sheet (e.g. customer name, email, productID)
3. Glide processes the update and the data is now customer data available in Glide

I quickly realised that if a customer purchases product A this works.  
However, if they later purchase product B or purchase products A and B then they could end up with two rows in the Sheet.

I want to limit access to emails in the customers table.  
I also don’t want to have duplicate emails in there.

Do I need to do some intermediary data processing to keep customers unique in Google Sheets? Or could I just add a new row for each order and not worry about having duplicate customers?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 19, 2022, 2:12pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/2 "2022-05-19T14:12:30Z")

</div>

So those are purchases that will make them users in your app?

What I would do with Integromat/Make:

- Add a watcher to watch for new Shopify orders.

- Create a Google Sheets search step right after that, searching for the email from the order against your Users sheet.

- Add a router.

- If a row is found, you can choose to update that row with info from the new order (let’s say if those products are subscriptions, and they upgraded to a higher subscription).

- If a row is not found, add a new row.

That way, you can make sure no duplicate rows (assuming emails should not be duplicated) are added.

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 19, 2022, 9:21pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/3 "2022-05-19T21:21:55Z")

</div>

Do you know which email is which in this list?  
 ![Screen Shot 2022-05-20 at 7.21.02 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/3/43124c6a1cc61da693a48e827c2b514b530b1565.png)

(I can use trial an error, but wondered if there was a way to differentiate 😆 )

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 19, 2022, 9:28pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/4 "2022-05-19T21:28:48Z")

</div>

Added the router.  
How do I configure the router?

 ![Screen Shot 2022-05-20 at 7.25.46 am](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/e/fe50327cb826e881d1d53ea78fe8ccb741865fbc.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 19, 2022, 11:21pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/5 "2022-05-19T23:21:00Z")

</div>

I think it should be the customer \> email one.

For the router:

Row found \> Row number exists

Row not found \> Row number does not exist.

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 20, 2022, 9:56pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/6 "2022-05-20T21:56:42Z")

</div>

awesome thanks, FYI this is for a client who already sells products via Shopify and instead of emailing a PDF with links to YT vids they wanted to send customers to an app that had that info instead (content is sports coaching). Got it all working.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 20, 2022, 9:57pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/7 "2022-05-20T21:57:06Z")

</div>

Great to hear!

---

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 20, 2022, 10:05pm UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/8 "2022-05-20T22:05:32Z")

</div>

## Phase 1 ✅

If order is a new customer, add customer to customers table and add [email], [program title] to a **purchases** sheet.

 ![purchases table](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/c/7c5abcc2e9651b70096e1b47b013dcad7709d73e.png)

## Phase 2

In _Phase 1_ every purchase needs it’s own row, e.g. if customer 1 purchases program A and then program B they will get two rows in the **purchases** sheet. This works perfectly and allows me to only show programs a customer has purchased when they log in. However, this means every purchase is a new row which takes up a lot of rows (there are currently five programs, 1 customer who busy all programs = 5 rows).

❓Can I use an array to store which programs a customer has purchased (and output array using an inline list)?  
If so, how would the data be structured so that I can only list all programs purchased by a customer?  
Anything special I would need to do when updating a row to add a subsequent purchase?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 21, 2022, 4:33am UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/9 "2022-05-21T04:33:50Z")

</div>

Well theoretically you can expand your structure with more columns (let’s say purchase 1 name, purchase 1 timestamp, purchase 2 name, etc. all the way to purchase 5). Not the cleanest structure in my opinion, but if row count is a problem for you then ok.

Then in Integromat/Make, do a search row step and then a router.

If purchase 1 name is empty then add an update row step to write to purchase 1 name and purchase 1 timestamp.

If purchase 1 name is not empty and purchase 2 name is empty then write to purchase 2 name and purchase 2 timestamp.

If purchase 2 name is not empty and purchase 3 name is empty then write to purchase 3 name and purchase 3 timestamp.

All the way to purchase 5.

For displaying it in an inline list, please adapt this method.

> [@fishbaguette\_breadbasket Transpose Columns to an Inline List: The Miracle Method](https://community.glideapps.com/t/transpose-columns-to-an-inline-list-the-miracle-method/32766):
>
> I’m often asked how to take columns of data (say form responses) and display them in an inline list. Here’s one way to do it—the MIRACLE METHOD. [[Glide: Transpose Data Columns into an Inline List with the MIRACLE METHOD] ](https://www.youtube.com/watch?v=t-sh_Q3WbQc)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 22, 2022, 4:33am UTC](https://community.glideapps.com/t/adding-shopify-orders-to-google-sheet-data-source/42141/10 "2022-05-22T04:33:52Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
