Shopify metafields allow you to store additional information for products, collections, orders, blogs, pages, and your shop that cannot be managed using Shopify’s native fields. For example, if you want to maintain extra description fields for your catalog, such as detailed descriptions or featured descriptions, you can easily create custom fields in NetSuite. However, in Shopify, this is achieved using the metafields functionality. A Shopify metafield includes a namespace, a key, a value, and an optional description. For additional info, refer to the Shopify help article.
Tip
-
Find additional Celigo migration resources at Shopify 2024-04 API release: Product REST API deprecation.
-
For information about metafields mapping at variant level using a saved search, see Map Shopify item metafields at the variant level using NetSuite saved search.
-
Celigo supports all Shopify metafields except list types and metaobjects.
The integration app enables you to map NetSuite standard/custom fields to Shopify metafields (if they already exist) and/or create the metafields in Shopify directly via the integration app and then map and update them. For best results, we recommend using the first approach, as it ensures a seamless and efficient mapping process while reducing complexity and potential errors.
The following are the available approaches:
-
Mapping NetSuite Standard/Custom fields to Shopify metafields (recommended approach): This method ensures a seamless and efficient mapping process, reducing complexity and potential errors.
-
Mapping NetSuite Standard/Custom fields to Shopify metafields (alternate approach): This method is more complex and may not be ideal for most use cases due to additional configuration requirements. We are still retaining this information as a reference for the existing users who have already configured using this approach.
Start by selecting the standard or custom field(s) in NetSuite that you want to map to the corresponding metafield in Shopify. In the example below, we have highlighted two fields (Long Text and Free Form) of an item that will be mapped to their respective Shopify metafields.
Next, navigate to the saved search in NetSuite used for exporting items from NetSuite to Shopify. If you are using the saved search provided by the bundle, its name should begin with "Celigo Shopify Item Export [your store name]." Open the saved search in edit mode and go to the Results tab.
Pre-requisite: Update the saved search with the metafields you want to sync to Shopify.
-
In the Results tab, click Edit > Edit this Search.
-
From the Field dropdown list, select Free form (Custom).
-
In the Custom Label textbox, copy and paste the format “<namespace>:<key>:<custom Label> (Meta)” of the Shopify field where you want to sync. For example, if the Shopify product metafield name is namespace1, follow these steps to copy the format:
-
Click the namespace1 field name and you will see an underlined link as shown in the screenshot below.
-
Click the hyperlink, which will redirect you to the namespace1 field details page.
-
Copy the text in the field Namespace and key.
-
-
Now, update the format in the NetSuite custom label to: namespace1:key1:nameofyourchoice (Meta)
Important
In the formatted text, the period (.) has been replaced with a colon (:), and a custom label has been added before the keyword (Meta) at the end.
-
In NetSuite Saved Search, navigate to the results column. From the Field dropdown list, select Long Text (Custom).
-
In the Custom Label textbox, copy and paste the format “<namespace>:<key>:<custom Label> (Meta)” of the Shopify field where you want to sync and apply the same formatting changes as you did for the Free Form (Custom) field.
Important
The Saved Search label name must be suffixed with "(Meta)" for the integration app to recognize it as a product metafield (see image below). For example, if you need to map the "namespace1" field, the Custom Label should be:namespace1:key1:nameofyourchoice (Meta).
This Custom Label format for product metafields is similar to that of variant metafields, with the only difference being the suffix:
-
For product metafields, use (Meta)
-
For variant metafields, use (variant Meta)
You can add as many fields as needed, and then save the changes to the Saved Search.
Field
Custom Label
Custom Field Values
Long Text (Custom)
custom:testtemplate:Valuetest (Meta)
Metafield Test iPad Simple Map
Free form (Custom)
namespace1:key1:Freeformvalue (Meta)
Demo Custom Mapping Simple Map
-
-
Now, go to integrator.io and navigate to the Shopify - NetSuite integration app.
-
In the Flows > Product, click NetSuite Item to Shopify Product Add/Update flow.
-
Click Post products to Shopify > Field Mappings.
-
You will see a few standard fields, such as Title, ID, Product Type, etc. Now, click the + icon next to the Title to add a new row under the Product object.
-
Select the data type as [Object] - array of object.
-
From the source object dropdown list, select the metafields object. In this case, it is meta [*].
-
In the destination object field, enter the name of your choice. In this case savedSearchProductMetafields.
Note
The field names are case-sensitive. Ensure that you enter the names with the correct capitalization.
-
Now, click Settings or Gear icon across the destination object. In this example, the savedSearchProductMetafields object.
-
In the Copy an object array from the source as-is? setting, select Yes. This setting will sync all your metafields from NetSuite to Shopify.
-
Click Save & close.
Once the mapping is complete, run the flow and you will see the updated metafield data in Shopify.
Viewing metafields in Shopify
Go to Shopify > Products to verify that the metafield values have been successfully synced to Shopify.
Start by selecting the standard or custom field(s) in NetSuite that you want to map to the corresponding metafield in Shopify. In the example below, we have highlighted a few fields that will be mapped to their respective Shopify metafields.
Next, navigate to the saved search in NetSuite used for exporting items from NetSuite to Shopify. If you are using the saved search provided by the bundle, its name should begin with "Celigo Shopify Item Export [your store name]." Open the saved search in edit mode and go to the Results tab.
In the Results tab, you will find all the fields configured for transfer to Shopify. In this use case, the fields ValueDemo(Meta) and ValueiPad(Meta) are utilized for metafield mapping.
Important
The label name must be suffixed with (Meta) to be identified as a metafield by the integration app (see image below). So for example: if you need to map the "ValueiPad" field, the custom label should be "ValueiPad (Meta)". Add as many fields as you like and then save the changes to the Saved Search.
-
Now, go to integrator.io and navigate to the Shopify - NetSuite integration app.
-
In the Flows > Product section, open the "Field Mappings" for the NetSuite Item to Shopify Product Add/Update flow.
-
Click Post products to Shopify.
-
Click + to add a new row under the product object.
-
Select the data type as [Object] - array of object.
-
From the source object dropdown list, select the metafields object. In this case, it is meta [*].
-
In the destination object field, enter the name of your choice. In this case savedSearchProductMetafields.
Note
The field names are case-sensitive. Ensure that you enter the names with the correct capitalization.
-
Click + within the object, to add a new row to your field mappings.
-
Click the field dropdown list.
-
Type in
ValueiPad (Meta)
and select.
-
-
Click + to add another field.
-
Click the field dropdown list.
-
Type in
ValueDemo (Meta)
and select.
-
Note
Namespace and key are colon-separated.
The following is an example of a namespace and key value in a sample Shopify Product API.
In the mapping section for destination fields, enter the namespace and key values for the ValueiPad (Meta)
and ValueDemo (Meta)
fields using the specified format above. Then, click Save to complete the mapping successfully.
Once the mapping is done, you can run the flow and you view the updated metafield data in Shopify.
Creating metafields if they do not exist
If you don't have metafields already created, directly add the 'namespace' and 'key' values in the mapping editor in the specified format (product.metafields[*].namespace:key) and the integration app will create the metafields in Shopify.
Viewing metafields in Shopify
Go to a Shopify Product and in the URL, append with the term 'metafields.json' and press 'Enter'.
A1: When syncing metafields from NetSuite to Shopify, if a metafield in NetSuite has a null value, the expected behavior is for the flow to delete the corresponding metafield in Shopify. The issue can be addressed by default if the metafields are configured in the integration app via Settings > Product > Specify your Shopify variant metafield components.
In case, you are using the mappings and facing this issue, the regular format in GraphQL mapping does not resolve it, but a specific configuration is required, as explained below.
To resolve this issue, follow these steps in integrator.io:
-
Go to integrator.io and open the Shopify - NetSuite integration app.
-
Navigate to Flows > Product section and open Field Mappings for the NetSuite Item to Shopify Product Add/Update flow.
-
Click on Post products to Shopify.
-
Click “+” to add a new row under the product object.
-
Select the data type as [Object] – array of objects.
-
In the destination object field, enter a name of your choice (e.g., savedSearchProductMetafields).
-
From the source object dropdown, select the metafields object ($.meta[0], $.meta[1], $.meta[2]).
-
This will create three columns where you can provide the source and destination field entries.
-
Save the changes.
By following these steps, NetSuite metafields with null values will correctly trigger the deletion of the corresponding Shopify metafields during syncing.