Mapping Single Line Text (List) Type Metafields in the Shopify-NS Product Flows

While the Shopify-NS IA doesn’t natively support list-type metafields, the following steps will allow you to use the saved search results to map a multi-select field from NetSuite products to a single line text (list) metafield on Shopify products.

NetSuite Multi-Select Field Example:

Shopify Single Line Text (List) Example:

In NetSuite:

  1. Navigate to the Celigo Shopify Item Export or Celigo Shopify Matrix Item Export saved search and click to the “Results” tab
  2. In a new row, select a “Formula (Text)” field and enter the following formula: CASE WHEN {field_id} IS NOT NULL THEN '["' || {field_id} || '"]' ELSE NULL END where “field_id” is the id of the multi-select field holding the values you are going to map to Shopify.
    image
  3. Give the formula a custom label per the Celigo Help Center documentation:
    1. namespace:key:description (Meta) for Product level metafields Map metafields at product level using the saved search
    2. namespace:key:description (Variant Meta) for Variant level metafield Map Shopify item metafields at the variant level using NetSuite saved search
  4. Save the saved search in NetSuite, the output of the formula should be similar to the example below
    image

In Celigo:

  1. Navigate to Settings > General > Sync Shopify metafield definitions, check the box, and click “save”
    1. This will make sure your metafield definitions are synced to the IA, so it knows what type of metafields are in your store
  2. Configure any additional mappings as required by the help articles mentioned above, the preview of the new mapping would look similar to the one below:
    image
  3. Run your product flow(s) and ensure the values sync to your Shopify product metafields

Why this works:

By returning the result in the Formula (Text) format in the saved search, you’re formatting the values in the format Shopify is expecting to receive them:

  • The CASE statement only supplies the values if any are selected in the field, otherwise it leaves the results blank (so you don’t end up with an orphaned string of [“”])
  • The single quotes specify the following text is to be interpreted literally, allowing the opening bracket and double quotes to be displayed without being escaped.
  • The double pipe operator acts as a join to combine that literal string with the output of the multi-select field you choose.
  • Finally, the closing literal string is joined after the field.
2 Likes