Skip to content

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. Please note: the flow commentary is produced using AI.

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
  • Multi-currency processing and assignment
  • Platform key assignment for external system tracking
  • Configurable field replacement policies

Salesforce fields#

This flow interacts with the Salesforce Product2 object and its related fields. Below is a comprehensive mapping of all fields utilised:

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 Picklist ISO currency code for multi-currency orgs
md_comm_pack__Platform_Key__c Text Stores unique external platform identifier
md_comm_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_comm_pack__Protect_Name__c is true, skips name processing
  • Name Assignment: Sets Name field from ProductName input 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 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 includes currency handling for multi-currency organisations:

Currency Determination:

  • Uses movedata__CurrencyCodeComponent to validate and normalise currency codes
  • Processes the CurrencyType input variable

Currency Assignment:

  • Checks if a valid currency code exists using the CurrencyTypeLen formula
  • Uses movedata__SetValueComponent to set the CurrencyIsoCode field when applicable
  • Only processes currency if the validated code has a length greater than 0

7. Platform key assignment#

  • Sets md_comm_pack__Platform_Key__c field 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_comm_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 validation through Apex components ensures only valid currency codes are processed

Dependencies#

  • movedata__CurrencyCodeComponent: Apex action for currency code validation
  • movedata__SetValueComponent: Apex action for dynamic field assignment
Ask MoveData AI
Ask about setup, configuration, or troubleshooting
How can I help you with MoveData today?