User Guide
  • Intro
    • Welcome
      • About DotApparel
      • What is DotApparel?
      • Where is it hosted?
      • What platform(s) do we support?
      • How does syncing work?
      • Solution architecture
      • Definition of “Instance”
      • Security Overview
    • Implementation
      • Google Cloud and Firebase
  • Quick Links
  • Core
    • Overview
    • Dashboard
    • Orders
      • Mappings
      • Integrations
    • Returns
      • Mappings
    • Products
      • Mappings
        • Default mapping rules
      • Translations
      • Markets
      • Publishing products
    • Inventory
      • Mappings
        • Examples
          • Ignore Sync
          • Inventory Buffer
          • Keep Items Sold Out
          • Unlimited Inventory
    • Customers
    • Rewards
    • System Alerts
    • Settings
      • Shopify Locations, DotApparel Locations and Inventory Buffers
      • ERP credentials
      • Product images
      • Fulfillments
      • Payment gateways
      • Gift cards
      • Refunds
      • Notifications
      • Harmony Integration with DotApparel
    • Modules
      • Ship From Store
      • Local Pickup/Click & Collect
      • Shopify Markets
      • Returns
        • Australia Post (AusPost)
        • Loop Returns
      • Auto-Refunds
        • Refunding Shopify Orders from POS (In-Store)
      • Integrate with Brauz (app)
      • Integrate with The Wishlist (app)
    • Release Notes
    • Troubleshooting
      • FAQs
      • How to raise a support ticket for an issue
      • Good and bad examples of a problem ticket
      • Want to enable a new omnichannel feature?
      • Want to integrate a marketplace using DotApparel?
  • Customers
    • Overview
      • Email Examples
    • Getting Started
      • Understanding Customer Setup in your ERP
      • Data Sync
      • Configuration
      • Testing
    • Data Export Approaches
      • Option A: Consultant
      • Option B: In-House
    • Apparel21 Export Templates
    • Apparel21 Export Changelog
    • Dashboard
    • Customers
    • Orders
    • Translations
    • Mappings
    • Settings
    • Support
  • Loyalty
    • Overview
    • Getting Started
      • Terminology
    • Data Sync
      • Workflows
    • Front-End Implementation
    • Rewards Redemption
    • Rewards Emails
    • Things To Know
Powered by GitBook
On this page
  • Customising your mappings
  • Rules
  • Template functions
  • slugify
  • stripTags
  • remove
  • truncateStr
  • truncateStrLeft
  • padStart
  • lowercase
  • uppercase
  • titlecase
  • splitStr
  • match
  • translate
  • Default mapping rules

Was this helpful?

Export as PDF
  1. Core
  2. Products

Mappings

PreviousProductsNextDefault mapping rules

Last updated 9 months ago

Was this helpful?

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.

  1. Only add a category tag when the category reference is not empty in ERP

  2. Add a category:tops tag, when the category reference in ERP is set to “shirts”, or “t-shirts”, allowing you to create a universal “tops” collection in Shopify

  3. Append - Clearance to the product title if the clearance reference is set to Yes

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

This 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

Removes 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.

web-care-label: "<ul> <li>Cold hand wash separately </li><li> </li><li>Do not bleach, soak, rub or tumble dry</li><li> </li><li>Cold rinse, gently squeeze to remove excess water</li><li> </li><li>Dry flat in shade</li><li> </li><li>Cool iron under protective cloth</li><li> </li><li>Dry cleanable (P)</li><li> <ul></ul></li></ul>"

This is how the template function would look like

{{#stripTags}}{{notes.web-care-label}}{{/stripTags}}

<ul> <li>Cold hand wash separately </li><li> </li><li>Do not bleach, soak, rub or tumble dry</li><li> </li><li>Cold rinse, gently squeeze to remove excess water</li><li> </li><li>Dry flat in shade</li><li> </li><li>Cool iron under protective cloth</li><li> </li><li>Dry cleanable (P)</li><li> <ul></ul></li>
</ul>

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

This 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

This 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

Similar 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

This 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

The 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

Similar 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

This 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

This 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,

index 0 - Blue
index 1 - #0000FF
index 2 - BLU

This is how the template function would look like

{{#splitStr}}{{notes.web-colour-details}}::,::1{{/splitStr}}

Blue,#0000FF,BLU

#0000FF


match

This 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

note: "This is a purchase order. Purchase Order Details: - PO #: PO0001111 - fabric Marketplace Order ID: 3964844 - Shipping Method: Ground."

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

The 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