How to Import Order Products with Data Loader in Salesforce

In Salesforce, the order product object represents an original product on an order. It can also represent a charge, such as a delivery charge. We can add products to an order manually via the Salesforce user interface. The Salesforce Data loader can be used to import and insert the number of Order Products (OrderItems).

In this Salesforce tutorial, we will learn to import order products with data loaded in Salesforce. In this process, we will add Order Products to existing Orders in Salesforce.

Import Order Products with Data Loader in Salesforce

To import Order Products with the data loader in Salesforce, there are the following considerations that we should be aware of.

  • The products you will import in Orders must be assigned to a Price Book.
  • The Currency code or Products, Contracts, and Orders should be familiar.
  • OrderItems are associated to Products via PricebookEntry records, so ensure Proce book have products in it.
  •  We can only add Order Items or Products via PricebookEntry records for the Pricebook that’s assigned to the Order.
  • It’s not possible to add Products to activated Orders. We can only import Order products for draft Orders.

Create a CSV file to import order products with the data loader in Salesforce

We first must create a CSV file with the following header column to import order products with the data loader.

  • ORDERID –  Record ID for the Order you’re adding products to. If adding multiple Products to the same Order, create an individual row for each unique Product to be added. To get the OrderID run an export from data loader for Order object.
  • PRICEBOKID – The record ID product’s entry is in the Price Book associated with the Order. To get this, run a data export for the PriceBookEntry object to generate a list of record IDs.
  • QUANTITY – Enter the number of products.
  • UNITPRICE – Enter the Unit price of the Order Product.
  • SERVICEDATE — Enter the Start Date for the order product, which should not be less than the start date of the order contract. The data must be entered in the date format in your org.
See also  How to Insert Null or Blank Values with the Salesforce Data Loader

The image below refers to the CSV file I created to import order products with data loader in Salesforce via data loader.

Insert order in Salesforce Products via data loader

Insert Order products from CSV file with Data loader

To insert the order products with data loaded from the CSV file we created in above stesp, open the data loader and follow the below steps.

1. Login with your crededntials in the data loader and click on the Insert button or click Upsert if you want to import new records and update the existing one.

Import Order products in Salesforce via data loader

2. In this step, activate the Show All Salesforce objects checkbox and select the Order Product (OrderItem) data object.

After this, browse the created CSV file and click on the Next button.

Salesforce Order Products import via data loader

3. As we click on the Next button, the data loader will initialize the uploaded CSV file and here click on the OK button to proceed.

4. In this step, we will map the data object fields with the header columns, and for that, click on the Create or Edit a Map button. Then, in the Mapping dialog window, click on Auto-Match fields and columns.

If the columns are not auto-matched with the object field name, then you have to drag the object fields down to the column mapping.

After mapping, click on the OK button and the Next button.

Use data loader to import order products in Salesforce

5. Select the location for the error and success files from where they can be accessed later.

At last, click on the Finish button.

Insert order products via Salesforce data loader

6. In the warning message of data operation, click on the Yes button to proceed.

See also  How to Insert File with Dataloader in Salesforce

7. Now the data loader will start the data insertion and after it’s completion a dialog box will display the number ok success and errors occurred during the data insertion.

Click on the OK button to close the Data Loader wizard.

Insert Products in Salesforce Orders via data loader

8. Now, to view the imported products in the order, open the Salesforce developer console and navigate to the Orders tab from the app launcher, then open the orders record in which you have imported products.

In the Order record, go to the section Order Products and there you will see the products that we have imported in the order using the Salesforce data loader.

Use data loader to import products to orders in Salesforce

In this way, we can import order products with a Data loader in Salesforce by following the above steps.


In Salesforce, products can be assigned manually but when it is required to assign mass products to the draft orders, then using the data loader is the go-to solution for that.

In this Salesforce tutorial, we have learned about the process of Importing order Products with the data loader, and by following the above steps, you can manage order products in your Salesforce instance.

You may like to read: