Back

Use the REST Connector to parse nested Value Arrays

Published: Jun 02, 2021
Post Author Written by Ethan Sorenson

When reading a REST API is common for custom fields and metadata related to a record be stored in an array. This creates a problem for SmartConnect because it parses each entry in the array as a separate line in your source. With the new source column type “ValueArray” we can now manually define how these fields should be parsed. Below is a sample query for a WooCommerce customer with 2 metadata fields.
 

Parsing Value Arrays

Parsing the values is a two-step process. First, we want to specify the location of the metadata object and set the data type to “ValueArray”.

ValueArray1

Once this is done, we can add our Calculated Fields to parse the values we want from the array. Below is a sample calculation to extract the ‘wc_last_active’ value from the array.

The end result looks like this:
ValueArray2

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

We're on your integration team. Connect with our people and let us know how we can help you.