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
6 0 6

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 4 (4)

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
6 0 6

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
1491 161 349

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.