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 utilise Order attributes (Additional details) to provide additional context to an order to help them either prepare or fulfil an order in a certain way or by a certain date.
Our Order attributes (Additional details) contains 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:
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.
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:
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)
- Date format required for the tag
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 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.
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:
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.
If you'd like to customise 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's worth giving your workflow a name to help you identify it at a later date, so add a workflow name in the New Workflow section, check the summary of your workflow and if happy, either Test your Workflow against an existing order or hit Save Workflow:
This criteria option will work if you choose to Backdate your orders.
Order attributes (Additional details) contains a date value you would like to reformat are not available to apply as Dynamic Tags.