Most APIs return data in different formats. Our Value Type options allow you to access the data in many different ways. Please refer to the definitions and examples below. If the option you need is not available for the data you’re are attempting to access, please contact support.
Sample Data Array
Refer to this data array for all examples below.
array(
'title' => 'Cool Product',
'desc' => 'Descriptions about a cool product.',
'gallery' => 'image-1.jpg,image-2.jpg,image-3.jpg',
'images' => array(
0 => array(
'href' => 'https://images.com/path/image-1.png'
),
1 => array(
'href' => 'https://images.com/path/image-2.png'
),
2 => array(
'href' => 'https://images.com/path/image-3.png'
)
)
);
Static Value
Static value is a user provided value that rarely changes and applies to all items.
Example: A brand or manufacture might be a static value that is not provided by your data source. But, applies to all items in a particular feed. Use the static value type to include a value for all items.
Result
All items will have an Brand attribute with a value of WP Data Sync
Dynamic Value
Dynamic Values are values in an array that must be accessed using Source Keys.
Example: Your item title is is nested in an array with a source key of title
.
Source Key Configuration
Result
The title of your item will be Cool Product.
Comma Separated String – Explode and All Values
Explode a comma separated string creating an array. Return all the values of that array as an array.
Example: You have an item meta value for a custom plugin that is stored as an array. Use this option to return the entire array. Keep in mind the WP Data Sync plugin is packed with action and filer hooks to apply custom functionality to your data.
Source Key Configuration
Result
An array containing the image names will be returned as post_meta
with a meta_key
of _my_custom_meta_key
.
Comma Separated String – Explode and First Value
Explode a comma separated string creating an array. Return the first value of that array.
Example: Your image gallery urls are included in a comma separated string in the sample data array under the source key gallery
. You want to use the first value as your Featured Image.
Source Key Configuration
Result
- https://my.images.com/path/to/images/image-1.jpg
Comma Separated String – Explode and Iterate Values
Explode a comma separated string creating an array. Return all the values while iterating through the array.
Example: Your image gallery urls are included in a comma separated string in the sample data array under the source key gallery
. You want to use all the values in your image gallery.
Source Key Configuration
Result
- https://my-images.com/image-1.jpg
- https://my-images.com/image-2.jpg
- https://my-images.com/image-3.jpg
Array – All Values
Return all the values of an array.
Example: You have an item meta value for a custom plugin that is stored as an array. Use this option to return the entire array. Keep in mind the WP Data Sync plugin is packed with action and filer hooks to apply custom functionality to your data.
Source Key Configuration
Result
An array containing the image urls will be returned as post_meta
with a meta_key
of _my_custom_meta_key
.
Array – First Value
Return the first value of an array.
Array – Interate Values
Return all the values while iterating through an array.
Dynamic String
A dynamic string is created of multiple static and dynamic values to create a single string.
Dynamic Content
Dynamic content is created of multiple static and dynamic values to create a block of content.
Order Value
Coming Soon!!
Item Value
Coming Soon!!