Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Default Value vs Empty mapped source field

1 Case: Skip blank values set to Yes

There are situations when mapped fields should be cleared. But Salesforce still contains old data. In such cases, you could use the “Default Value” field to populate Salesforce with correct data

Let’s see an example with some custom mapping

  • Go to Magneto Admin panel - Salesforce - Field Mappings - Product

...

  • Click the “Add New Mapping“ button

...

  • For example select

    • Magento Attribute as Product: Weight

    • Salesforce Attribute as Product Description

    • Skip blank values set to Yes

  • Click the Save Mapper button

...

  • Go to Magento Admin panel - Catalog - Products - Add a new product

  • Fill all required fields

  • Fill Weight field for example “8“

  • Save product

...

  • Select the Salesforce tab and click on the “Salesforce Product ID“ link

  • Check the “Product Description” field

...

Product Description” field will contain weight value

  • Now Go to Magento Admin panel - Catalog - Products - Edit product

  • Delete thevalue in Weight files and Save the product

...

  • Go back to Salesforce Product Page and refresh it

...

Value in the “Product Description” field will do not change to empty

  • Go to Magneto Admin panel - Salesforce - Field Mappings - Product -Edit custom mapping

  • Fill “Default Value“ field with “0

...

  • Save Mapper

  • Go to Magento Admin panel - Catalog - Products - Sync product with Salesforce

  • Go back to Salesforce Product Page and refresh it

...

Value in the “Product Description” field will contain “0“ - mapping Default Value

2 Case: Skip blank values set to No

There is another workflow where blank values are not skipped. Let’s modify created mapping for Product Weight.

  • Open created mapping

  • Skip blank values set to No

  • Click the Save Mapper button

...

  • Go to Magento Admin panel - Catalog - Products - Edit product

  • Delete the value in Weight files and Save the product

...

  • Sync edited product

  • Go back to Salesforce Product Page and refresh it

...

Value in the “Product Description” field is empty - Skip blank value is enabled

In the situation when we use blank value (Skip blank values set to No) and the default value is set as well, the default value will be synced to Salesforce.

  • Open created mapping

  • Skip blank values set to No

  • Default value set to 1

  • Click the Save Mapper button

...

  • Sync edited product

  • Go back to Salesforce Product Page and refresh it

...

Value in the “Product Description” field will contain “1“ - mapping Default Value.

The reverse synchronization from Salesforce to Magento works in the same way. If ‘Skip blank values’ is set to No after deleting the value in Salesforce and re-sync, the value in Magento will be reset.

  • Open created mapping

  • Clear Default value

  • Skip blank values set to No

  • Click the Save Mapper button

...

  • On Salesforce Product page clear Product Description field

...

  • Click Sync with Magento button

  • Go to Magento Admin panel - Catalog - Products - Edit product

...

Value in the “Weight” field is empty - we passed empty value from Salesforce (Skip blank value is set to No.