Catalog mapping flow
Note
This flow is self-documenting and should be viewed within Salesforce (Setup > Process Automations > Flows). This document is to support working through a visual flow. The flow commentary in this document was generated with AI assistance.
Overview#
Flow name: MoveData_Commerce_Catalog_Mapping Label: [MoveData] Commerce: Catalog - Mapping Type: Auto-Launched Flow Template API version: 56.0 Status: Active
This flow handles the mapping and transformation of catalog data from external commerce platforms into Salesforce Product2 records, with configurable field mapping and replacement rules.
Purpose#
The flow processes incoming catalog data and maps it to appropriate Salesforce Product2 fields while handling:
- Product name mapping with protection rules
- Product code assignment with conditional replacement
- SKU (Stock Keeping Unit) mapping with flexible source options
- Product description handling
- Status mapping for active/inactive products
- Currency code determination and assignment
- Platform key assignment for external system tracking
- Configurable field replacement policies
Salesforce fields#
| Field API name | Field type | Purpose in flow |
|---|---|---|
| Id | ID | Unique record identifier |
| Name | Text (255) | Product name identifier |
| ProductCode | Text (255) | Product code/identifier |
| StockKeepingUnit | Text (255) | SKU for inventory tracking |
| Description | Long Text Area | Detailed product description |
| IsActive | Checkbox | Indicates if product is currently active |
| CurrencyIsoCode | Text | ISO currency code for multi-currency orgs |
| md_npc_pack__Platform_Key__c | Text | Stores unique external platform identifier |
| md_npc_pack__Protect_Name__c | Checkbox | Prevents automatic updates to product name |
Input variables#
Core product data#
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
Product2 SObject | Yes | The Product2 record being processed |
ProductName |
String | No | Product name from external platform |
Code |
String | No | Product code/identifier |
Description |
String | No | Product description |
Status |
String | No | External platform status (active/inactive) |
CurrencyType |
String | No | Currency code from external platform |
PlatformKey |
String | No | Unique platform key |
Configuration variables#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_CatalogSetProductCode |
Boolean | true | Whether to set product code field |
Config_CatalogReplaceProductCode |
Boolean | true | Whether to replace existing product codes |
Config_CatalogSetProductSku |
Boolean | false | Whether to set SKU field |
Config_CatalogReplaceProductSku |
Boolean | true | Whether to replace existing SKUs |
Config_CatalogSetProductDesc |
Boolean | true | Whether to set description field |
Config_CatalogReplaceProductDesc |
Boolean | true | Whether to replace existing descriptions |
Config_CatalogProductSkuUseCode |
Boolean | true | Whether to use Code instead of PlatformKey for SKU |
Output variables#
| Variable | Type | Description |
|---|---|---|
Record |
Product2 SObject | Updated Product2 record |
Flow logic#
1. Name processing#
The flow first determines if the product name should be updated:
- Protection check: If
md_npc_pack__Protect_Name__cis true, skips name processing - Name assignment: Sets
Namefield fromProductNameinput if provided and not protected
2. Product code mapping#
Product code assignment follows conditional logic:
Assignment conditions:
Config_CatalogSetProductCode = true AND (
Config_CatalogReplaceProductCode = true
OR (Config_CatalogReplaceProductCode = false AND ProductCode is null)
)
Logic:
- If replacement is enabled: Always sets the product code
- If replacement is disabled: Only sets if existing ProductCode is null
3. SKU processing#
SKU assignment uses a formula to determine the source value:
SKU source formula:
CatalogProductSku = IF(Config_CatalogProductSkuUseCode == TRUE, Code, PlatformKey)
Assignment conditions:
Config_CatalogSetProductSku = true AND (
Config_CatalogReplaceProductSku = true
OR (Config_CatalogReplaceProductSku = false AND StockKeepingUnit is null)
)
Examples:
- If
Config_CatalogProductSkuUseCode = true: SKU = Code value - If
Config_CatalogProductSkuUseCode = false: SKU = PlatformKey value
4. Description mapping#
Description assignment follows the same conditional pattern:
Assignment conditions:
Config_CatalogSetProductDesc = true AND (
Config_CatalogReplaceProductDesc = true
OR (Config_CatalogReplaceProductDesc = false AND Description is null)
)
5. Status mapping#
External platform statuses are mapped to the Salesforce IsActive field:
| External status | IsActive field |
|---|---|
| active | true |
| (all others) | false |
Default behaviour: Any status other than "active" sets IsActive to false.
6. Currency processing#
The flow handles currency code assignment through action calls:
- Determine currency: Calls
movedata__CurrencyCodeComponentto validate and process currency code - Currency assignment: Uses
movedata__SetValueComponentto set CurrencyIsoCode if valid currency provided - Length check: Uses
CurrencyTypeLenformula to verify currency code exists before assignment
7. Platform key assignment#
- Sets
md_npc_pack__Platform_Key__cfield with the provided platform key - Always executed regardless of configuration settings
- Used for external system tracking and duplicate detection
Configuration logic patterns#
Conditional field assignment#
The flow uses a consistent pattern for configurable field assignment:
Pattern:
IF (
Config_Set[Field] = true
AND (
Config_Replace[Field] = true
OR (Config_Replace[Field] = false AND [Field] is null)
)
) THEN
Set [Field] = [Value]
Behaviour:
- Set = false: Field is never updated
- Set = true, Replace = true: Field is always updated
- Set = true, Replace = false: Field is updated only if currently null
Default configuration values#
| Configuration | Default | Purpose |
|---|---|---|
Config_CatalogSetProductCode |
true | Enable product code mapping |
Config_CatalogReplaceProductCode |
true | Allow overwriting existing codes |
Config_CatalogSetProductSku |
false | Disable SKU mapping by default |
Config_CatalogReplaceProductSku |
true | Allow overwriting existing SKUs when enabled |
Config_CatalogSetProductDesc |
true | Enable description mapping |
Config_CatalogReplaceProductDesc |
true | Allow overwriting existing descriptions |
Config_CatalogProductSkuUseCode |
true | Use Code field for SKU instead of PlatformKey |
Protection mechanisms#
The flow includes protection fields to prevent overwriting existing data:
md_npc_pack__Protect_Name__c: Prevents name updates when enabled- Configuration-based protection for other fields through replace flags
Error handling#
- Uses conditional logic to handle null values gracefully
- Skips field assignment when conditions are not met
- Validates configuration settings before processing each field
- Currency code validation through dedicated components
Dependencies#
movedata__CurrencyCodeComponent(Apex action)movedata__SetValueComponent(Apex action)