We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How determine in Shopify flow discounts by Shopify line item script?

How determine in Shopify flow discounts by Shopify line item script?

IvGordiichuk
Shopify Partner
39 1 9

Hi. 
I want to add promo tag to order by Shopify flow. 
Can flow can detect if Shopify line item script worked with cart?
The line item script itself cannot add tags to the order. That's why I want to create a flow. If the line item script has applied a discount, add the promo tag to the order.

But in  flow settings I did not find how to determine the discount given by the line item script.
I can define a discount in a flow, but I also have other discounts (coupons, ..).
I only need the discounts applied by the line item script.

Replies 3 (3)

paul_n
Shopify Staff
1828 199 435

The only way currently to detect if a script ran via Shopify Scripts is to search the text that appears on the event timeline that shows up under the Order. It's available in Flow via `order / events`. I think the message field would work. 

 

https://shopify.dev/api/admin-graphql/2022-07/interfaces/Event

 

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.
IvGordiichuk
Shopify Partner
39 1 9

Thanks! I'll test.

IvGordiichuk
Shopify Partner
39 1 9

Solution didn't work. I really hoped it would work. Maybe I didn't set it up correctly?
My order with script message 

IvGordiichuk_0-1663232131149.png

IvGordiichuk_1-1663232166176.png

IvGordiichuk_2-1663232188072.png

IvGordiichuk_3-1663232256322.png

Thank You