Solved

Calculate the sum of specific line item value for Customer over a period of time

Sam-Rise-ai
Shopify Partner
3 0 3

Hi, 

 

I'm looking to, under specific conditions, sum the value of one specific line item/product purchased by a customer. 

e.g. Customer A buys "product 123"

Get all orders a Customer A has made in the past week

Sum the total value of "product 123" that customer has bought in the past week. 

 

I was thinking something like this: 

Screenshot at Mar 31 16-13-46.png

 

If this isn't possible, I would also be happy with a product count option, however, at the moment, the only action I can see is a Sum of the quantities of ALL line item properties over a specific period. 

 

Any help here please?

Accepted Solution (1)

DaveMcV
Shopify Staff
87 26 24

This is an accepted solution.

Hi @Sam-Rise-ai,

 

The count and sum options do not currently work conditionally, but you'd be able to use the Run code action to build JavaScript to sum or count that data and make it available to downstream steps.

 

More information on how that action works can be found in the Shopify Flow documentation for Run code

 

Hope that helps!

DaveMcV | Flow Development 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)

DaveMcV
Shopify Staff
87 26 24

This is an accepted solution.

Hi @Sam-Rise-ai,

 

The count and sum options do not currently work conditionally, but you'd be able to use the Run code action to build JavaScript to sum or count that data and make it available to downstream steps.

 

More information on how that action works can be found in the Shopify Flow documentation for Run code

 

Hope that helps!

DaveMcV | Flow Development 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.
Sam-Rise-ai
Shopify Partner
3 0 3

Thanks @DaveMcV, I'll give that a go. 

Much appreciated