Difference between Tags (List) & Tags (String)
The main difference between the conditions of Tags (List) and Tags (String) is the level at which these fields are present.
In general, Tags (List) is a list of tags contained within entries (orders/customers/products). On the other hand Tags (String) will be a comma-separated value of tags.
For example, Assume that you have a product with tags A, B, and C. While configuring a "Product" type workflow with the following fields:
- Product -> Tags (List) --> This will be a list containing tags e.g, ["A", "B", "C"]
- Product -> Tags (String) --> This will be comma-separated value of tags e.g, "A, B, C"
Thus, while writing conditions using "Product -> Tags (List)" since the value is of list type, you also need to choose a "multi-operator" to suit your use case i.e, Any of / All of / None of. While if you just use "Product -> Tags (String)", since the value is a simple string, there's no need to specify multi-operator.
[Note: To learn about the use of multi-operators, please refer to Workflow condition multi-operators.
Basically, The use of "Tags (String)" is generally easier to understand, while the use of multi operators and Tags (List) can be a little tricky.
Here are some concrete examples, to understand a little more about the similarities and differences of Tags (List) and Tags (String):
- "Any of Product -> Tags (List) is A" is equivalent to "Product -> Tags (String) contains A".
- "None of Product -> Tags (List) is A" is equivalent to "Product -> Tags (String) does not contain A"
Order -> Line Items -> Product -> Tags (List) & Tags (String)
In contrast to the Product Tags, "Order -> Line Items -> Product -> Tags" requires the use of multi-operators for both Tags (List) and Tags (String). The simplest way to understand this is that an order may have multiple line items resulting in multiple strings w.r.t product tags.
Suppose there is an order with line items and associated product tags as follows:
- Product1 with (tag1, tag2, tag3)
- Product2 with (tag1, tagX, tagY)
- Product3 with (tag1, tagA, tagB)
The way "Order -> Line Items -> Product -> Tags" gets evaluated is as follows:
- "Order -> Line Items -> Product -> Tags (String)" This will be a set of strings with respect to products in the line items as shown above i.e, ["tag1, tag2, tag3", "tag1, tagX, tagY", "tag1, tagA, tagB"]
- "Order -> Line Items -> Product -> Tags (List)" This will be a list containing all the product tags e.g, ["tag1", "tag2", "tag3", "tag1", "tagX", "tagY", "tag1", "tagA", "tagB"]
Thus, while writing conditions using "Tags (List)" since the value is of list type, it gets evaluated by going through all tags (tag's list). On the other hand, if you use "Tags (String)" since the value is a set of strings, the specified multi-operator will operate w.r.t strings.
Here are some concrete examples, to understand a little more about the similarities and differences of Tags (List) and Tags (String):
-
If you want to tag the order if all of the line items separately have "tag1" in them. Then, The condition "All of -> order -> line items -> tag (string) contains tag1" will be used to evaluate and tag accordingly. Please note that In the above example using Tag(list) instead of Tag(string) will evaluate false for tag1, since it will look for the tag in the list (shown above) without separating the strings associated with different line items.
-
Both the conditions "Any of -> order -> line items -> tag (string) contains tagA" and "Any of -> order -> line items -> tag (list) contains tagA" will evaluate to true as both the tags list and set of string contains "tagA" in them.