Articles in this section

Map metafields at product level using the saved search

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

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:

  1. Mapping NetSuite Standard/Custom fields to Shopify metafields (recommended approach): This method ensures a seamless and efficient mapping process, reducing complexity and potential errors.

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

Mapping NetSuite Standard/Custom fields to Shopify metafields (recommended 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.

1st_image_.png

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.

2nd_image.png

Pre-requisite: Update the saved search with the metafields you want to sync to Shopify.

  1. In the Results tab, click Edit > Edit this Search.

  2. From the Field dropdown list, select Free form (Custom). 

  3. 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:

    1. Click the namespace1 field name and you will see an underlined link as shown in the screenshot below.

    2. Click the hyperlink, which will redirect you to the namespace1 field details page.

      3rd_image.png
    3. Copy the text in the field Namespace and key.

      4th_image.png
  4. 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.

  5. In NetSuite Saved Search, navigate to the results column. From the Field dropdown list, select Long Text (Custom).

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

    5th_image.png
Map Shopify metafields to NetSuite
  1. Now, go to integrator.io and navigate to the Shopify - NetSuite integration app.

  2. In the Flows > Product, click NetSuite Item to Shopify Product Add/Update flow.

  3. Click Post products to Shopify > Field Mappings.

    6th_image.png
  4. 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.

  5. Select the data type as [Object] - array of object.

  6. From the source object dropdown list, select the metafields object. In this case, it is meta [*].

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

    7th_image.png
  8. Now, click Settings or Gear icon across the destination object. In this example, the savedSearchProductMetafields object. 

    8th_image.png
  9. 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.

    9th_image.png
  10. 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.

10th_image.png

Mapping NetSuite Standard/Custom fields to Shopify metafields (alternate 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 a few fields that will be mapped to their respective Shopify metafields.

Map_meta_1.png

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.

map_2.png

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.

Map_meta_3.png

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.

Map_meta_4.png
  1. Now, go to integrator.io and navigate to the Shopify - NetSuite integration app.

  2. In the Flows > Product section, open the "Field Mappings" for the NetSuite Item to Shopify Product Add/Update flow.

  3. Click Post products to Shopify.

  4. Click + to add a new row under the product object.

  5. Select the data type as [Object] - array of object.

  6. From the source object dropdown list, select the metafields object. In this case, it is meta [*].

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

    Map_meta_5.png
  8. Click + within the object, to add a new row to your field mappings. 

    1. Click the field dropdown list.

    2. Type in ValueiPad (Meta)and select.

      Map_meta_6.png
  9. Click + to add another field. 

    1. Click the field dropdown list.

    2. Type in ValueDemo (Meta)and select.

Map_meta_7.png

Note

Namespace and key are colon-separated.

Map_meta_8.png

The following is an example of a namespace and key value in a sample Shopify Product API.

Map_meta_9.png

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.

Map_meta_10.png

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

Map_meta_11.png
Map_meta_12.png
IA_Image_.png
FAQsQ1: Why is my metafield with a null value in NetSuite not being deleted in Shopify?

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:

  1. Go to integrator.io and open the Shopify - NetSuite integration app.

  2. Navigate to Flows > Product section and open Field Mappings for the NetSuite Item to Shopify Product Add/Update flow.

  3. Click on Post products to Shopify.

  4. Click “+” to add a new row under the product object.

  5. Select the data type as [Object] – array of objects.

  6. In the destination object field, enter a name of your choice (e.g., savedSearchProductMetafields).

  7. From the source object dropdown, select the metafields object ($.meta[0], $.meta[1], $.meta[2]).

    3_column_names.png
  8. This will create three columns where you can provide the source and destination field entries.

    Config_format_mapping.png
  9. Save the changes.

By following these steps, NetSuite metafields with null values will correctly trigger the deletion of the corresponding Shopify metafields during syncing.