Add order note with UPC of line items that contain certain tag

Add order note with UPC of line items that contain certain tag

PaleBlueDot
Tourist
8 0 7

I need to add an order note with the barcode (UPC) of certain products within the order that contain a certain tag. So if a product in an order has the tag "In Stock at A" and does not have the tag "In Stock at B"  I want an order note added with the barcode of that product.

I have found the "Update order note" action as well as the barcode variable but I can't figure out how to filter which barcodes are pushed through.

Any help would be greatly appreciated.

Replies 8 (8)

Erika383Rivera
Visitor
2 0 0

@PaleBlueDot wrote:

I need to add an order note with the barcode (UPC) of certain products within the order that contain a certain tag. So if a product in an order has the tag "In Stock at A" and does not have the tag "In Stock at B"  I want an order note added with the barcode of that product.

I have found the "Update order note" action as well as the barcode variable but I can't figure out how to filter which barcodes are pushed through.

Any help would be greatly appreciated.


Hello!

To add an order note with the barcode of products tagged "In Stock at A" and not "In Stock at B," you can filter products to identify the ones with the desired tags, extract their barcodes, and then update the order note with these barcodes. Use a script to filter products with the tag "In Stock at A" and without "In Stock at B," extract their barcodes, and join them into a single string. Finally, use the "Update order note" action to add this string to the order note. Adjust the script to suit your specific platform and programming language needs.

Erika383Rivera
Visitor
2 0 0

@Erika383Rivera wrote:

@PaleBlueDot wrote:

I need to add an order note with the barcode (UPC) of certain products within the order that contain a certain tag. So if a product in an order has the tag "In Stock at A" and does not have the tag "In Stock at B"  I want an order note added with the barcode of that product.

I have found the "Update order note" action as well as the barcode My iTero variable but I can't figure out how to filter which barcodes are pushed through.

Any help would be greatly appreciated.


Hello!

To add an order note with the barcode of products tagged "In Stock at A" and not "In Stock at B," you can filter products to identify the ones with the desired tags, extract their barcodes, and then update the order note with these barcodes. Use a script to filter products with the tag "In Stock at A" and without "In Stock at B," extract their barcodes, and join them into a single string. Finally, use the "Update order note" action to add this string to the order note. Adjust the script to suit your specific platform and programming language needs.


Did that prove to be useful for you?

 

PaleBlueDot
Tourist
8 0 7

Hello! First of all thanks for the response. This seems like it would work but could you explain in a little more details how I go about making the script to filter products with certain tags?

paul_n
Shopify Staff
1576 170 363

If you mean that you are not sure how to add the tags conditions, it would look like:

 

If at least one of order / lineItems 

If at least one of lineItems_item / product / tags

is equal to "Stock at A"

 

To add the second condition to check that it doesn't have the other tag, you need to "Add criteria" for that same line item (very important) and then choose:

 

None of lineItem_item / product / tags

is equal to "In Stock at B"

 

 

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.
PaleBlueDot
Tourist
8 0 7

I believe that is what I am doing. Attached is what I have so far but it doesn't seem to be working.

 

I need it to filter out all line items from the order that are tagged with In Stock at All Media Supply but are not tagged with In Stock at Pale Blue Dot Records. Then I need all those product UPCs added to the order notes.

I feel like I'm close but it isn't working.


Capture.jpg

paul_n
Shopify Staff
1576 170 363

In that condition you are checking if a single tag is both that first value AND not the second value. Since when the first it true, the second will always be true, this effectively ignores the second condition. 

 

You want to add a condition to the same line item. It should say "None of product / tags is equal to ...." . You are currently instead using "Does not include", which again is checking just a single tag, so if any tag doesn't have that include that value it will be true (basically always).

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.
PaleBlueDot
Tourist
8 0 7

Ok that makes sense. I just changed it, did I get it right this time?

 

Now my only issue is it doesn't seem to be updating the order note with the filter values.

 

Capture.jpg

paul_n
Shopify Staff
1576 170 363

You are missing the second part of the condition to check the other tag, but that's the general idea. 

 

It's checking If at at least one of the line items doesn't have the product tag .

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.