Product documentation
Patchworks services
Patchworks services
  • Services documentation
  • Getting started
    • What is a service?
  • Roles & Permissions
    • Roles & permissions summary (services)
  • Working with Services
    • Accessing services
    • The services list
    • The anatomy of a service
      • Service summary
      • Service canvas
      • Service filters
      • Service trigger
      • Service source
      • Service destination
      • Service mapping
      • Service alerts
      • Payload script
      • Run service
      • Service settings
    • Adding a Patchworks service
      • Add a default service
      • Configure service settings
      • Set the service trigger schedule
      • Define service filters
      • Define field mappings
      • Activate the service
    • Cloning an existing service
    • Updating a service
      • Service notes
      • Using a payload-level custom script in services
    • Removing a service
    • Field mappings & transformations (services)
      • Field mappings (services)
        • Mapping metafields for products (services)
      • Field transformations (services)
        • Transform function reference (services)
        • Using a custom script in field transformations (services)
      • Transform mapping/lookup tables (services)
      • Legacy shipment & payment maps (services)
  • Service connectors
    • What is a service connector?
    • Accessing service connectors
    • The anatomy of a service connector
    • Adding a service connector
    • Updating a service connector
    • Removing a service connector
  • Reporting & logging
    • Service sync reports
      • Viewing the service sync report
      • Handling failed service syncs
      • Sync failure email notifications
    • Service sync logs
    • Viewing logs for custom script activity in services
  • Service systems
    • Service systems
    • Supported service systems
      • Active Ants (service connector)
        • Finding service connector credentials for Active Ants
      • BigCommerce (service connector)
        • Finding service connector credentials for BigCommerce
        • Additional setup notes for BigCommerce (services)
      • Bleckmann (service connector)
        • Finding service connector credentials for Bleckmann (API)
      • Bleckmann Returns (service connector)
        • Finding service connector credentials for Bleckmann (Returns)
      • Bleckmann SFTP (service connector)
        • Finding service connector credentials for Bleckmann (SFTP)
      • Brightpearl (service connector)
        • Finding service connector credentials for Brightpearl
        • Additional setup notes for Brightpearl (services)
      • Business Central (service connector)
        • Finding service connector credentials for Business Central
      • Citrus-Lime (service connector)
        • Finding service connector credentials for Citrus-Lime
      • CommerceTools (service connector)
        • Finding service connector credentials for CommerceTools
      • Cybertill (service connector)
        • Finding service connector credentials for Cybertill
      • Descartes Peoplevox (service connector)
        • Finding service connector credentials for Peoplevox
        • Configuring Peoplevox as a data destination (services)
        • Quick setup CSV files for Peoplevox (services)
      • Dynamics NAV (service connector)
        • Finding service connector credentials for Dynamics NAV
      • Emarsys (service connector)
        • Finding service connector credentials for Emarsys (FTP)
      • EposNow (service connector)
        • Finding service connector credentials for EposNow
      • Global-e (service connector)
        • Finding service connector credentials for Global-e
      • Inventory Planner (service connector)
        • Finding service connector credentials for Inventory Planner
      • Khaos Control (service connector)
        • Finding service connector credentials for Khaos Control
      • Lightspeed Retail R-Series (service connector)
        • Authorising Patchworks to access your Lightspeed Retail R-Series account (services)
      • Lightspeed Retail X-Series (service connector)
      • Linnworks (service connector)
        • Finding service connector credentials for Linnworks
      • Magento 2 (service connector)
        • Finding service connector credentials for Magento 2
        • Required settings for Magento 2.4.4+ (services)
      • Mirakl (service connector)
        • Finding service connector credentials for Mirakl
      • Navision (service connector)
      • NetSuite (service connector)
        • Authorising Patchworks to access your NetSuite account (services)
        • Required NetSuite features (services)
        • Working with NetSuite custom fields (services)
        • Setting unique IDs for NetSuite product syncs (services)
        • NetSuite concurrency (services)
        • Troubleshooting NetSuite connections (services)
        • Additional setup notes for NetSuite (services)
        • Legacy service connector setup for NetSuite
          • Installing the Patchworks bundle for NetSuite (services)
          • Finding connector credentials for NetSuite (services)
      • Odoo (service connector)
        • Finding service connector credentials for Odoo
      • Ometria (service connector)
        • Finding service connector credentials for Ometria
      • Patchworks SFTP (service connector)
        • Finding basic auth service connector credentials for SFTP
        • Finding ssh auth service connector credentials for SFTP
        • Specifying a non-root folder as the file location (services)
        • Adding entity schemas (services)
      • Plytix (service connector)
        • Finding service connector credentials for Plytix
      • Prima (service connector)
        • Finding service connector credentials for Prima
      • ReBound (service connector)
        • Finding service connector credentials for ReBound
      • SAP Business One (service connector)
        • Finding service connector credentials for SAP Business One
      • Seko (service connector)
        • Finding service connector credentials for Seko (API)
        • Finding service connector credentials for Seko (FTP)
      • Shopify / Shopify+ (service connector)
        • Finding service connector credentials for Shopify (token auth)
        • Finding service connector credentials for Shopify (legacy auth)
        • Additional setup notes for Shopify (service connector)
      • Sitoo (service connector)
        • Finding service connector credentials for Sitoo
      • SparkLayer (service connector)
        • Finding service connector credentials for SparkLayer
      • The Edge by John Lewis (service connector)
        • Finding service connector credentials for The Edge by John Lewis
      • TikTok Shop (service connector)
        • Finding service connector credentials for TikTok Shop
      • Torque (service connector)
        • Finding service connector credentials for Torque
      • Veeqo
        • Finding service connector credentials for Veeqo
      • Vend (service connector)
        • Finding service connector credentials for Vend
      • Visualsoft (service connector)
        • Finding service connector credentials for Visualsoft
      • Voyado (service connector)
        • Finding service connector credentials for Voyado
      • WooCommerce (service connector)
        • Finding service connector credentials for WooCommerce
      • ZigZag (service connector)
        • Finding service connector credentials for ZigZag
  • Troubleshooting
    • How to manage failed service syncs
    • How to run a service manually
    • How to deactivate/activate a service
    • How to check the operational status of a service connector
    • What to check if you can't save a new service connector
    • How to handle an empty mapping page
    • What to do if your third-party systems go offline
  • Inbound API
    • Inbound API for services
    • Using the Inbound API connector with Patchworks services
      • Adding an inbound API connector with a custom payload
      • Generating token credentials for API access
      • Adding a Patchworks service for an inbound API connector
        • Add a default service
        • Configure service settings
        • Set the service trigger schedule
        • Define field mappings
        • Activate the service
      • Implementing API requests
  • Support
    • Raising a support ticket
Powered by GitBook
On this page
  • Introduction
  • Identify your metadata fields
  • Set the inject metadata option for the service source
  • Confirm the mapping path for destination fields
  • Define destination mappings
  1. Working with Services
  2. Field mappings & transformations (services)
  3. Field mappings (services)

Mapping metafields for products (services)

PreviousField mappings (services)NextField transformations (services)

Introduction

The approach for mapping metadata fields associated with products differs from standard mappings.

Typically, n. The same applies to metadata fields except we don't specify source mappings. Instead, we configure the required Patchworks service(s) to inject metadata from the source data, into your mapped destination fields. In other words, you only need to define destination mappings for metadata fields - the source side is taken care of automatically.

This advanced task requires an understanding of JSON files and data structures.

The steps required to map metadata fields are summarised below:

Identify your metadata fields

You'll need to know the names (or keys) for your required metadata fields, and the namespace that they belong to. For example:

How you obtain this information varies, depending on your source system. If you are an advanced editor, and comfortable working with JSON files for your data, it's very likely that you'll already have this information to hand.

Shopify example

In Shopify you can access a sample entity (e.g. a product or an order) in the Shopify admin console and then append the following to the URL:

/metadata.json

For example:

Press Enter to see related metadata details for this record:

...paste this into a code editor for readable formatting:

Set the inject metadata option for the service source

In Patchworks, an inject metadata option must be 'switched on' for whichever service(s) you run to sync data between systems. To do this, follow the steps below:

Step 3 Click the button and make sure that the following line is present:

"inject_meta_data": "true",

If this line isn't present, add it now. If it's present but set to false, change it to true.

Step 4 Save changes and go straight to the steps below.

Confirm the mapping path for destination fields

We will be mapping metadata fields manually via the JSON editor. Before that, it's useful to check the field mapping UI to confirm the dot notation path for the required destination fields. To do this, follow the steps below.

Step 2 Choose to add new row.

Step 3 On the right-hand side, click the destination field and search for the first field that you wish to define as a destination for a metadata field. Typically, 'attribute' fields are used for this purpose:

As you navigate this hierarchy, note the path to the required field(s). In our example, attributes are not nested but yours may vary (e.g. products.0.Attribute1). In the case of our example there is no hierarchy - the attribute fields are at the top level.

Step 5 Having noted all required field paths, cancel the new row and go straight to the steps below.

Define destination mappings

Step 1 Click the advanced editor button at the top of the mappings page.

Existing mappings for this service are displayed - source mappings are on the left and destination mappings are on the right. For example:

Step 2 For metadata fields, we only need to define destination mappings. When the service runs, any metadata found in the source data is injected into these destination fields.

Scroll to the bottom of the destination pane and add an entry for each required metadata item. The required format is shown below:

The elements here are summarised below:

Element
Required information

path to destination field

The dot notation path to the required destination field for this metadata item.

attributes

This is a static value - it should always be included.

namespace

metafield

The metadata item to be injected into this field

However, if your required destination fields are NOT already present, you should add them using the syntax shown above. For example:

"Attribute1": {
  "pw_value": "attributes.google/condition"
},

When defining metadata mapping entries, you only need the pw_value.

Step 3 Save the mapping file. Next time this service is run, metadata items will be injected into your mapped destination fields.

Step 1 Log in to the Patchworks dashboard and select from the left-hand navigation menu.

Step 2 Select the service that you wish to update and click the tab. Information for the source system is displayed - for example:

Step 1 Click the tab for the service.

The advanced editor button is only displayed if your user account is defined with additional advanced editor permissions. If you are familiar with editing JSON files and require access to this option, please .

The namespace that this metadata item belongs to (as noted ).

This is where the paths that you noted may be needed. Often, you will find that the default mapping file already includes the fields that you require - especially is you are injecting metadata into attribute fields. In this case, all you need to do is update pw_value entries for each metadata item.

services
source
mappings
contact Patchworks support
previously
earlier
Identify your metadata fields
Set the inject metadata option for the service source
Confirm the mapping path for destination fields
Define destination mappings
field mappings are defined from a source system to the required destinatio