Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Explore Business Manager Import and Export

Learning Objectives

After completing this unit, you’ll be able to:
  • List three data objects you can transfer via the import/export process.
  • Explain the purpose of Salesforce B2C Commerce XSD files.
  • Explain one benefit of using the Read-Only Price Books feature.
  • Explain two benefits of object-specific schema files.
  • Explain how you use instances to roll out storefront data.

Introduction

Linda Rosenberg is a new admin at Cloud Kicks, a high-end custom sneaker company. Her top responsibility is data management. Specifically, she needs to manage the transfer of storefront data between external systems and B2C Commerce. She also needs to help move site configuration and settings data from one instance to another to bring new developer instances online.

Cloud Kicks develops catalog details such as SKU numbers, product descriptions, sizes, images, prices, and so on in a system of record, and Linda must use import processes to transfer that data into B2C Commerce. Meanwhile, anytime shoe shoppers create orders, redeem coupons, and more in B2C Commerce, Linda needs to ensure that data goes to an external system for processing. For that she uses export processes.

Note

A storefront is your online ecommerce site powered by B2C Commerce. A single instance can include multiple storefronts.

Linda Rosenberg, Cloud Kicks Administrator

In this unit, Linda learns some basics about how B2C Commerce handles import and export. Later on, she puts the concepts into action as she tries out manually triggered or “batch” processes and site import/export with B2C Commerce. Let’s follow along.

Before Linda can try out the site import/export features in B2C Commerce, she needs to know:

  • The types of data that Cloud Kicks imports and exports.
  • The instance types that Cloud Kicks admins and developers use.
  • How schema files work, and which schema files she needs to be familiar with.
  • How B2C Commerce handles data validation.

Storefront Data Import/Export

Linda learns that Cloud Kicks imports and exports the following types of storefront data.

Imports Exports
Active data Coupon redemptions
Catalog Customer records
Coupons Orders
Order updates (cancels, returns, shipping)
Price Books

Cloud Kicks’s processes are straightforward, and its external systems support the B2C Commerce file structure. That means Linda can use the manual Business Manager import/export process for most things. However, Cloud Kicks maintains large and complex price books in a third-party product information management (PIM) system that it updates frequently. So instead of using the Business Manager import process, Cloud Kicks uses the Read-Only Price Books feature to import its price data. This feature makes the mass transfers much more efficient.

Import to Staging

B2C Commerce gives customers four types of instances: sandbox, staging, development, and production. Sandbox instances are where the developers work, so Linda only uses a sandbox instance when she works with a developer to edit or create a new import or export process. Once they’ve tested the new process, the developer moves it from the sandbox to the staging instance for her to use.

Linda uses the staging and development instances to import and export storefront data. The staging instance is where she gets ready for the data transfer. After testing the storefront data and code in staging, she replicates it first to the development instance and then to the production instance. She uses the development instance to verify that the transfer was successful before pushing it to production.

Record archival and cleanup is an important and final step in the import process. Once a week, Linda uses manual processes to archive the previous XML files and eliminate older files and unnecessary data. When she deletes the record of an import she performed in Business Manager, it automatically removes the related log file.

Schema Files

Linda learns that B2C Commerce schemas are a big part of what makes import and export happen. Schemas are a set of object-specific XSD files that define how the XML import and export files must be structured. B2C Commerce only accepts XML import files formatted by these schemas. When Linda imports a file manually through Business Manager, B2C Commerce automatically validates it against its respective schema.

Cloud Kicks works with a partner to configure the external systems so they produce the XML files in the structure required by the schema. Linda familiarizes herself with the external jobs that produce import files so she can accommodate changes. For example, sometimes schemas change and she needs to know how the change impacts her import or export processes.

B2C Commerce automatically exports files in the proper XML format, except for coupon codes, which it exports to the CSV format.

These are the schema files that she pays close attention to:

  • catalog.xsd
  • coupon.xsd
  • couponredemption.xsd
  • customer.xsd
  • customeractivedata.xsd
  • order.xsd
  • pricebook.xsd

Data Validation

As we mentioned, when Linda imports a file manually through Business Manager, data validation against the schema is automatic. If she uses another way to import data, such as programmatically, she must ask a developer to help her validate the data programmatically.

Sometimes users create data manually in Business Manager, for example, when Traude Beck, the merchandiser, adds details to product data. If her product details don’t follow the schema, the data will be invalid and the export (and maybe even the nightly backups) will fail. To get the export working, Linda must ask Traude to edit the data so she can try the export again.

Most B2C Commerce schemas specify that schema elements are optional. This means that Linda only needs to include the elements that she wants in each XML file she uses for import. However, she also needs to ensure that she includes any dependent elements. For example, if she imports product data on “platform sneakers,” she must include all the categories they are assigned to. If she forgets to include one (such as the “platform” category) in the import, B2C Commerce ignores this category assignment and reports it in the error log.

Let’s take a closer look at some elements now, so you can see what we’re talking about.

Elements and Attributes

We learned that schemas provide the rules, and the resulting XML file contains the data, hopefully in the correct format.

The schema rules take into consideration the nature of a particular object and its attributes. This gives you granular control over object-specific data, and it helps you better understand your data. That’s where elements and attributes come in. Elements are data objects and attributes describe those objects. For example, the catalog.xsd—remember, this is the catalog schema—includes category and product elements.

This is an example of a category element in an XML file generated from a catalog schema.

<category category-id="womens-shoes-sandals">
    <display-name xml:lang="x-default">Sandals</display-name>
    <online-flag>true</online-flag>
    <parent>womens-shoes</parent>
    <template/>
    <page-attributes/>
</category>

The display-name attribute is the name of the category that displays on the storefront. The online-flag attribute, set to true, means that the category is visible on the storefront. The parent attribute names the parent category of the womens-shoes-sandals sub-category.

This is an example of a product element in an XML file.

<product product-id="008884303989">
    <ean/>
    <upc>008884303989</upc>
    <unit/>
    <searchable-flag>true</searchable-flag>
    <tax-class-id>standard</tax-class-id>
    <page-attributes/>
    <custom-attributes>
         <custom-attribute attribute-id="color">navy</custom-attribute>
         <custom-attribute attribute-id="size">007</custom-attribute>
         <custom-attribute attribute-id="width">N</custom-attribute>
    </custom-attributes>
    <pinterest-enabled-flag>false</pinterest-enabled-flag>
    <facebook-enabled-flag>false</facebook-enabled-flag>
</product>

The upc attribute indicates the product’s universal product code (UPC). Other attributes include the searchable-flag and the tax-class-id, in this case, set to standard.

Next, Linda gets familiar with some important import/export rules for the three most common elements she works with: category, product, and order.

Category Elements

These are some element-specific rules to consider when importing a category element.

  • Category elements can appear in any order in the XML file.
  • A catalog's root category isn't deleted with the delete or replace modes. It’s updated with the replace mode. (We explore modes in the next unit.)
  • Deleting a category deletes the category's category assignments (not the products within the category), category links (incoming and outgoing), and all subcategories.
  • The root category's display name and description is also set as the catalog's display name and description.

Product Elements

These are some element-specific details to consider when importing a product element.

  • Product elements can appear in any order in the XML file.
  • The bundle, product set, and base product types are mutually exclusive, so the bundled-products, product-set-products, and variation elements are also mutually exclusive.
  • You can't specify variants of the bundle, product set, or base product types.
  • Variation products and variation groups are owned by exactly one base product. You can change the ownership from one base product to another in a single import process.

Order Elements

Linda exports Cloud Kicks orders and processes them in an order management system. B2C Commerce automatically handles order-specific details such as order status, credit card processing, rollback, and returns.

Next Steps

In this unit, Linda learned about the types of data she handles via import/export, instance types, schema files, and how B2C Commerce validates data. Next, she learns how to use modes for global and element-specific import and export processes.

Resources

Note

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback