Mappings
This feature gives you full control of mapping rules so that you can better utilise the data that's available in the ERP. You can configure certain product attributes in the ERP and enrich them further for Shopify. For example, combine title and colour together to create Shopify product titles.
Customising your mappings
"Mappings" are templates and rules linked to specific Shopify attributes. DotDev will set up these mappings for you based on your preferences, but you can also update them yourself.
To access the mappings, go to Products > Mappings. Here, you'll see a list of Shopify attributes and their associated mappings. For example, you can map ERP references to Shopify tags, as shown in the screenshot.


Rules
Each mapping contains one or more “rules”. When the DotApparel app is calculating the value of a particular Shopify attribute, it will first find any mappings attached to that field, and then for each mapping, loop over the rules until one evaluates to true.
In the screenshot above, we can see that the rule will only evaluate to true if the references.category.name attribute on the product is not empty.
For the first rule which evaluates to true, the attached template will be applied, and no further rules within that mapping will be executed.
Rules are a powerful way of changing the value of attributes in Shopify based on a series of conditions in ERP, and can be used for a huge array of purposes. Here are some examples of how you could use rules in your mappings.
Only add a category tag when the category reference is not empty in ERP
Add a
category:topstag, when thecategoryreference in ERP is set to “shirts”, or “t-shirts”, allowing you to create a universal “tops” collection in ShopifyAppend
- Clearanceto the product title if theclearancereference is set toYes
Template functions
DotApparel provides some powerful template functions to allow users to perform string manipulation tasks. From simple transformations like changing case or truncating strings to more complex operations like translating text or matching patterns, these helpers are here to make your development process smoother.
Explore the functions described in the following sections to discover how they can aid in your specific use case, and feel free to incorporate them into your templates as needed.

slugify
slugifyThis function transforms any given string into a URL-friendly version, removing any special characters and spaces. It's particularly useful for creating slugs for URLs in web applications.
Usage
{{#slugify}}STRING{{/slugify}}
Example
Given the AP21 field notes > web-care-label and you want to slugify it.
web-care-label: "Cold hand wash separately"
This is how the template function would look like
{{#slugify}}{{notes.web-care-label}}{{/slugify}}
Cold hand wash separately
cold-hand-wash-separately
stripTags
stripTagsRemoves all HTML tags and CSS rules from the given input string. It can be useful in scenarios where you want to present pure textual data, stripping out any styling or scripting elements.
Usage
{{#stripTags}}STRING{{/stripTags}}
Example
Given the AP21 field notes > web-care-label and you want to remove HTML tags and CSS it.
This is how the template function would look like
{{#stripTags}}{{notes.web-care-label}}{{/stripTags}}
Cold hand wash separately Do not bleach, soak, rub or tumble dry Cold rinse, gently squeeze to remove excess water Dry flat in shade Cool iron under protective cloth Dry cleanable (P)
remove
removeThis function facilitates the removal of specific substrings from a given text. It can be applied when you need to find and remove certain patterns or words from a text string.
Usage
{{#remove}}substring1::substring2::STRING{{/remove}}
Example
Given the AP21 field notes > web-care-label and you want to remove the word "cold" and "hand".
web-care-label: "Cold hand wash separately"
This is how the template function would look like
{{#remove}}cold::hand::{{notes.web-care-label}}{{/remove}}
Cold hand wash separately
wash separately
truncateStr
truncateStrThis function is used to shorten a string to a specified maximum length, cutting off characters from the right side. This might be useful for displaying previews of long texts.
Usage
{{#truncateStr}}sourceString::maxLength{{/truncateStr}}
Example
Given the AP21 field notes > web-care-label and you want to truncate to 13 characters.
web-care-label: "Cold hand wash separately"
This is how the template function would look like
{{#truncateStr}}{{notes.web-care-label}}::13{{/truncateStr}}
Cold hand wash separately
Cold hand was
truncateStrLeft
truncateStrLeftSimilar to truncateStr, the truncateStrLeft function cuts off characters from the left side of the string up to a specified maximum length. It serves the purpose of displaying the ending part of long texts.
Usage
{{#truncateStrLeft}}sourceString::maxLength{{/truntruncateStrLeftate}}
Example
{{#truncateStrLeft}}{{notes.web-care-label}}::13{{/truncateStrLeft}}
padStart
padStartThis function pads the beginning of a given string with another string until the resulting string reaches a specific length. It's handy for aligning texts or filling with specific characters, such as zeros.
Usage
{{#padStart}}sourceString::padString::targetLength{{/padStart}}
Example
Imagine you have an AP21 product code "K884" and you need to ensure it always displays as an 8-character string, padding it with zeros at the beginning if necessary.
productCode: "K884"
This is how the template function would look like
{{#padstart}}{{productCode}}::0::8{{/padstart}}
K884
0000K884
lowercase
lowercaseThe lowercase function converts all characters in a given string to lowercase. It's useful for standardising text input or creating case-insensitive comparisons.
Usage
{{#lowercase}}STRING{{/lowercase}}
Example
Given the AP21 field notes > web-care-label and you want to convert to lowercase.
web-care-label: "COLD HAND WASH SEPARATELY"
This is how the template function would look like
{{#remove}}{{notes.web-care-label}}{{/remove}}
COLD HAND WASH SEPARATELY
cold hand wash separately
uppercase
uppercaseSimilar to lowercase, this function transforms all characters in a string to uppercase. It's beneficial for emphasising text or handling case-insensitive processing.
Usage
{{#uppercase}}STRING{{/uppercase}}
Example
Given the AP21 field notes > web-care-label and you want to convert to uppercase.
web-care-label: "cold hand wash separately"
This is how the template function would look like
{{#uppercase}}{{notes.web-care-label}}{{/uppercase}}
cold hand wash separately
COLD HAND WASH SEPARATELY
titlecase
titlecaseThis function transforms the first letter of each word in the given string to uppercase and the rest to lowercase. It helps in formatting titles or headings in a standardized way.
Usage
{{#titlecase}}STRING{{/titlecase}}
Example
Given the AP21 field notes > web-care-label and you want to transform the first letter of each word to uppercase.
web-care-label: "Cold hand wash separately"
This is how the template function would look like
{{#titlecase}}{{notes.web-care-label}}{{/titlecase}}
Cold hand wash separately
Cold Hand Wash Separately
splitStr
splitStrThis function breaks down a string into substrings using a specified separator and returns the substring at a given index. It's useful for parsing delimited data like CSV or user input.
Usage
{{#titlecase}}sourceString::separator::index{{/titlecase}}
Example
Given the AP21 field notes > web-colour-details and and you want to split it by commas and retrieve the hex code which is represented on the second item (index 1 since indexing starts from 0)
web-colour-details: "Blue,#0000FF,BLU"
Behind the scenes when splitting,
This is how the template function would look like
{{#splitStr}}{{notes.web-colour-details}}::,::1{{/splitStr}}
Blue,#0000FF,BLU
#0000FF
match
matchThis function finds all occurrences of a specified regular expression pattern in a string and returns the matched groups. It can be used for complex text parsing, data extraction, and validation scenarios.
Usage
{{#match}}regexPattern::sourceString{{/match}}
Example
Given the Shopify order field note, and you want to extract the order number PO0001111
Regex pattern: PO #: (PO\d+)
This is how the template function would look like
{{#match}}PO #: (PO\d+)::{{note}}{{/match}}
"This is a purchase order. Purchase Order Details: - PO #: PO0001111 - fabric Marketplace Order ID: 11112222 - Shipping Method: Ground."
PO0001111
translate
translateThe translate function looks up a string in a predefined translation mapping and returns the corresponding translation.
Usage
{{#translate}}translation_table_id::attribute_to_lookup{{/translate}}
For more details, please refer to Translations
Default mapping rules
If there are no mapping rules set, DotApparel will populate default values for some key Shopify fields. For more details, please refer to Default mapping rules.
Last updated
Was this helpful?