Tag orders based on Order attributes (Additional details) - with date reformatting
Order attributes are custom form fields that let you collect additional information from your customers on the cart page of your Shopify store. Order attributes are often referred to as additional details or cart attributes.
Many Merchants utilize Order attributes (Additional details) to provide additional context to an order to help them either prepare or fulfill an order in a certain way or by a certain date.
Our Order attributes (Additional details) contain a date value you would like to reformat criteria is specifically targeted at order attributes that have a date as the attribute value, for example:
Name: collection-delivery-date
Value: 28-05-2020
These attributes are usually assigned to the order by third-party apps, scripts or services that present the Customer with a date picker, where they can select when they would like to either collect an order, or have their order delivered.
Often, the format of the date in the order attribute value is not in an acceptable format to be applied as a tag. Some 3rd party logistics companies, for example, need the date to be in a specific format.
Our Order attributes (Additional details) contains a date value you would like to reformat criteria (catchy isn't it...) allow you to reformat the date, before then applying it as a tag on your order.
Please Note:
This criteria will not reformat the original order attribute, it will only reformat the date to be applied as a tag on the order.
How to use the criteria
To create a workflow using this criteria, click on the Create New Workflow button from the main Workflows view:
Define the trigger to determine at which point you would like the workflow to run, we recommend selecting the trigger when orders are created.
Click the Add criteria to my workflow button:
The Order attributes (Additional details) contains a date value you would like to reformat criteria can be found within the Order category in the Select criteria pop-up window:
You will then be presented with the following screen of customisable fields:
Criteria Fields
Let's take a look at each of the fields within this criteria and find out how they can be configured:
- Order attribute
- Date format of the order attribute
- Adjust by days (optional)
- Prefix
- Date format required for the tag
- Suffix
Order attribute
This field allows you to define the name of the order attribute that contains a date value.
You may need to take a look at some of your existing orders to find the exact name of the order attribute.
When configuring this field, please ensure that the order attribute is entered exactly as it appears in your orders, observing where there are capital letters, spaces and any special characters such as hyphens or underscores.
Within the ADDITIONAL DETAILS section of an order, the order attribute name will appear immediately above the order attribute value:
Date format of the order attribute
This field requires that you select the format of the date that appears as the order attribute value.
In the example already shown above, we can see that the date format of the collection-delivery-date order attribute is DD-MM-YYYY.
The available date format options are as follows:
Select the option that matches the order attribute value date format.
Adjust by days (optional)
If you need the date that appears in the order attribute to either have a number of days added or removed from the date that gets applied as the tag, then we have an optional field called Adjust by days that will let you change that date to X days before or after the date in the order attribute.
For example, if your order attribute value was 28-05-2020 and you wanted to add 3 days to the date that gets applied as a tag, then you'd configure the field to 3:
This would apply a tag of 31-05-2020 to the order.
If you wanted to subtract 6 days to the date that gets applied as a tag, then you'd configure the field to -6:
This would apply a tag of 22-05-2020 to the order.
Tag Prefix
This option will also allow you to specify a Prefix as the first part of the tag before the date or day. This can help to identify what the tag is related to. You can use a prefix to identify what the date tag relates to, for example
- Shipping Date: 02/01/2021
- Delivery Date: 02/01/2021
- Order Date: 02/01/2021
This is especially useful if you are applying multiple dates to your orders and need to be able to filter them by meaning.
Date format required for the tag
This field allows you to select the format that you'd like the date to be in when it is applied to your order as a tag. The available date format options are as follows:
In addition to all the date formats available, we recently added a way to add a tag with the difference in business days (or calendar days) from the creation of the order to the delivery date. When selecting this option, you will be able to choose the Holiday Region (Calculating business days):
For calendar days, just pick the option "Difference in days since creation"
For business days, pick the option "Differences in business days since creation"
Tag Suffix
This option will also allow you to specify a Suffix as the last part of the tag after the date or day. Similar to the Prefix, this can help to identify what the tag is related to.
Example
If you'd like to customize this criteria to look for orders that contain an order attribute name of collection-delivery-date and change the format from DD-MM-YYYY to Day of week - you would need to configure the criteria as follows:
In this example, the tag Thursday would then be applied to the order.
Naming and saving your workflow
It is mandatory to name your workflow to save or edit it. Otherwise, you won't be able to save the changes or even test them. Then, check the summary of your workflow, and if happy, either Test your Workflow against an existing order or hit Save Workflow:
Backdating
This criteria option will work if you choose to Backdate your orders.
Dynamic Tagging
Order attributes (Additional details) contains a date value you would like to reformat are not available to apply as Dynamic Tags.