Getting a specific customer data in Shopify flow

Getting a specific customer data in Shopify flow

mave_mohiuddin
Shopify Partner
6 0 2

What is the best way to retrieve a specific customer data in Shopify flow?

For my purpose, I am working on a reference program. When a customer requests a shareable link, the customer.id is added to the register url of the shop and presented as a shareable link. It looks something like as follows:

https://{shop}.com/account/register?reference={customer id}

When someone register using the URL, I'm adding the reference value as a note to the new customer account.

Then Shopify flow picks up the "Customer Created" trigger, and checks if the customer has a 'reference' note. If it does, Flow assigns a metafield value for the newly created customer account. It's working as expected up to this point.

I also want Flow to update a metafield value of the customer who shared the link. Here's where the problem arises. what is the best way to get the customer object of the customer who shared the link? from the newly created account, I can access the customer.id of the sharer. 

If a shop has a small number of customers, then it'll not be difficult, I can fetch 100, and filter. But when the shop will have thousands of customer account,(I don't know how much, I just want it to scale reliably) can I reliably do it with id?

Reference of the workflow.
work_flow.png

Replies 4 (4)

heddykhalifa
Shopify Partner
236 17 51

Hey Mave_mohiuddin,

Heddy from Gameball: Loyalty Program & VIP here!

While Shopify Flow doesn't allow direct access to specific customer data, you can use workarounds like customer tags or custom fields via apps like Shopify Scripts or Mechanic to trigger actions based on those attributes. If you’re looking for more advanced options, Gameball offers powerful customer segmentation and data analytics, allowing you to personalize campaigns and automations based on behavior and purchase history—going beyond what Flow offers.

Let me know if you'd like more details on setting this up!

mave_mohiuddin
Shopify Partner
6 0 2

Thank you very much for the insight. I'll try to make use of tags. This is a passion project, not for a customer's request. Thus, I am not considering using an app for solution. However, if I end up doing it for a customer, I'll consider Gameball. 

SamuelR
Tourist
8 0 1

Hi Mave,

 

Did you ever find a solution? I’m working on a similar system. I spent a lot of time trying to add tags to customers where the referrals come from, but I always run into the same problem with the maximal 100 customers sorting. 

The customer who send the referral needs an tag the same time when the referral is used. Maybe you found a solution? Please let me know!

paul_n
Shopify Staff
1564 170 361

To the original question, the customer query supports an "id" filter, so you should be able to pass that directly in. It will return a list of 1 item if there is a match, so you would still need to use "For each" to loop over the customers and call that Update customer metafield action. 

 

You could also use "Send Admin API request" to update the customer metafield. In that action, you must set the ID yourself, which means that you can set it to the ID you get from the note. 

 

https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/metafieldsSet

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.