Creating a unique primary ID is an optional process. This is only used if the source of your data does not already provide a static unique ID.
What is a Unique Primary ID?
A unique primary ID is a data field used to distinguish each row of your data. The primary ID must be static, meaning it never changes. Examples are incremental ID, product SKU, UPC code, or manufacture ID. You would not want to use a name or title as they are subject to change.
How to Create a Unique primary ID
To create a unique primary ID, WP Data Sync uses multiple static fields of data combined to create the unique ID. You may first want to review the documentation for Source Keys.
array( 'pid' => '12321', 'psname' => 'CMV', 'pcname' => 'GST', 'title' => 'Cool Example Product', 'description' => 'A really cool product that will save you time.' );
In the example data you will see that
descriptions are most likely dynamic fields. These can and probably will change over time. However,
psname are static fields that will never change. We will use the static fields to create a unique primary ID.
Steps to Create a Unique Primary ID
- Set Value Type to Dynamic String
- Type a formatted string using merge tags
- Configure Merge Tags and the associated Source Keys
- Choose the desired Sanitize Value method
Using the example data above. This will create a unique primary ID as follows.