How to enable an optional item in ShopifyFlow

Solved

How to enable an optional item in ShopifyFlow

AS-FFO
Tourist
4 1 0
We are using ShopifyFlow to create tasks in external system.
 
Current logic is checking whether the Vendor attribute from an order line items are matching the predefine value. If so, it will make an HTTP request to create a task for a contact who manages those Vendors.
 
As a business we offer a product called "Risk-Free Flat Rate Return" 
Some orders are now including this item. Other orders may not include this item. Now I am trying to figure out how to configure ShopifyFlow to accommodate such a logic. This is where I need your help. This is how I would word it:
 
======
All conditions are met
All Order items
If a Vendor of and order line item is "ABC"
OR
If a Vendor of and order line item is "XYZ"
OR
If a Vendor of and order line item is "ZZZ"
AND
If an order items name is "Risk-Free Flat Rate Return" (NOTE: It may or may not present)
======

Examples of a desired logic outcome:

Example A
Order contains 2 items:
- Item 1 from Vendor "ABC"
- Item 2 from Vendor "XYZ"
Condition MATCH

Example B
Order contains 2 items:
- Item 1 from Vendor "ABC"
- Item 2 from Vendor "GGG"
Condition FAILED (as logic doesn't expect Vendor "GGG")

Example C
Order contains 3 items:
- Item 1 from Vendor "ABC"
- Item 2 from Vendor "XYZ"
- Item 3 named "Risk-Free Flat Rate Return"
Condition MATCH

Example D
Order contains 3 items:
- Item 1 from Vendor "ABC"
- Item 2 from Vendor "GGG"
- Item 3 named "Risk-Free Flat Rate Return"
Condition FAILED (as logic doesn't expect Vendor "GGG")

Example E
Order contains 1 item:
- Item 1 named "Risk-Free Flat Rate Return"
Condition FAILED (as there are should be line items for vendors)

Basically, the main challenge is to add the optional "Risk-Free Flat Rate Return" item.
Any ideas?
 
Thanks!
Accepted Solution (1)
AS-FFO
Tourist
4 1 0

This is an accepted solution.

I ended up adding the desired item to the Check If block with another OR condition and it seems to work fine.

 

ASFFO_0-1688617701355.png

 

View solution in original post

Replies 6 (6)

DaveMcV
Shopify Staff
101 31 27

Hi AS-FFO,

 

Based on your summary, having at least one item from a certain vendor AND at least one product matching a certain product name would be something like this:

DaveMcV_0-1687187671583.png

 

 

You have Example A not checking for the item name, which confused me a bit, but you could restructure the Condition above to handle that how you see fit. Once you are happy with your logic and want to test it, you can manually run the Workflow on some orders to validate that it works correctly. 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.
AS-FFO
Tourist
4 1 0

Thanks Dave. It looks promising, but I am not sure if this going to work when "Risk-Free Flat Rate Return" is absent. It looks like the entire "Check if" block will result in FALSE. While for me it should not be the case.

Basically, I wants the "Check if" block to be TRUE when one of the vendors in my list and an OPTIONAL presence of "Risk-Free Flat Rate Return" line item.

Does it makes sense?

DaveMcV
Shopify Staff
101 31 27

If it's optional, try changing the AND to an OR

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.
AS-FFO
Tourist
4 1 0

> try changing the AND to an OR

 

I can see only the "AND" condition in the middle of the screenshot and it doesn't appear to be changeable. 

DaveMcV
Shopify Staff
101 31 27

The "If all conditions are met" dropdown should change to "If any conditions are met". This will flip change the check from AND to OR.

 

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.
AS-FFO
Tourist
4 1 0

This is an accepted solution.

I ended up adding the desired item to the Check If block with another OR condition and it seems to work fine.

 

ASFFO_0-1688617701355.png