Shopify Flow: filter by customer orders in Get Customer Data action

Solved

Shopify Flow: filter by customer orders in Get Customer Data action

Ed_Graham
Excursionist
17 1 0

I am using an advanced query in a Get customer data action in a workflow to retrieve customer records.  At the moment, my query is matching more than 100 records, so only the first 100 are returned.

 

I would like to add something to my query to filter customers based on whether they have currently any unfulfilled orders.  (See image below.)  Is this possible?

Shopify9.png

Accepted Solution (1)

paul_n
Shopify Staff
1679 184 385

This is an accepted solution.

Docs for filters on this query: https://shopify.dev/docs/api/admin-graphql/2024-04/queries/customers#argument-query-filter-default. TL;DR - you can't filter customers on that. I think segmentation also doesn't allow checking order / unfulfilled status. 

 

You could instead set a tag of customers after they place an order and clear it when the order is fulfilled (unless they have other orders that are unfulfilled). I think that would require 2 workflows to make work.

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.

View solution in original post

Replies 2 (2)

paul_n
Shopify Staff
1679 184 385

This is an accepted solution.

Docs for filters on this query: https://shopify.dev/docs/api/admin-graphql/2024-04/queries/customers#argument-query-filter-default. TL;DR - you can't filter customers on that. I think segmentation also doesn't allow checking order / unfulfilled status. 

 

You could instead set a tag of customers after they place an order and clear it when the order is fulfilled (unless they have other orders that are unfulfilled). I think that would require 2 workflows to make work.

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.
Ed_Graham
Excursionist
17 1 0

Thanks Paul.  I had read the docs: I was just surprised that there are so few filters available for customers.  As you say, segmentation doesn't help because it seems that the same set of filters are available there as there are in workflows (i.e., the Flow app); so if I can't craft a custom query to do something, I generally can't create a segment to do it either.

 

Your idea of separate workflows makes sense, however, so I might try that.  Thanks again.