Working with WooCommerce Metadata Fields

Published: Oct 02, 2025

Working with WooCommerce Metadata Fields

Published: Oct 02, 2025

The WooCommerce Connector for SmartConnect has access to all the standard WooCommerce fields. If integration with metadata fields is required, these steps can be followed.

Find the Metadata field key

WooCommerce allows dynamic assignment of metadata which allows external applications to store metadata without a central setup. Due to this setup, the naming of the field is often controlled externally and reviewing existing records is the only way to discover the field key.

  1. Log into WooCommerce.
  2. Open an example record for the object containing the metadata field.
  3. In the sidebar, locate the category Custom Fields.
  4. For the metadata needed, copy the Name of the field.

Add the Custom Fields array as a Data Source Field

  1. Log into SmartConnect > Maintenance > REST Services.
  2. Edit the WooCommerce REST Service.
  3. Select Data Sources and edit the data source you will modify.
  1. Select the Fields tab and add a new field named meta_data with a type of ValueArray as show below.
  1. Click Save.

Add a Source Calculation to extract field value

  1. On the Service Data Sources > Fields tab scroll to the bottom and click Add Calculated Field.
  2. Set the Field Name to a name that is easy for you to find.
  3. Set the Field Type to String.
  4. Enter the below Script in the window.
  5. On the second line of script replace Test with the key for your field.
//Replace the value below with the caption for your custom field.
var myFieldName= "Test"

var list = eval(<<meta_data>>);
if(list.length == 0) return '';
for(var I = 0; I < list.length; I++){
  var item = list[I];
  if(item.key == myFieldName)
    return item.value;
}
return '';

Add Calculation to Data Source fields

  1. Navigate to the Data Source setup screen for your data source.
  2. Click add data source or select your existing data source.
  3. Click Select Fields add the calculated field to the data source.
  4. Preview and verify data is returned for the column.
  5. Save the data source.
Content
Find the Metadata field key Add the Custom Fields array as a Data Source Field Add a Source Calculation to extract field value Add Calculation to Data Source fields

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

Reset Filters