Salesforce is a widely used, robust CRM tool that facilitates streamlining pricing through Price Books in the Salesforce org. The Price Books in Salesforce serve as catalogs for product pricing, allowing businesses to define different prices for products based on various criteria.
In this Salesforce tutorial, we will learn to associate products with both Standard Price Books and Custom Price Books using the Salesforce Data Loader.
Data Loader to Associate Products with Price Books
In Salesforce, a Data Loader is a powerful tool that enables bulk data import and export operations, and using a data loader to associate products with standard and custom price books can be advantageous in various ways, especially when dealing with large datasets or systematically managing the pricing information of the products.
Associate Products to Standard Price Book via Data Loader
Before inserting or associating products to price books, we will run an export for the data object Price Book 2 by following the steps.
- Open the Data Loader.
- Export the ‘PriceBook2‘ object.
- We need ‘PriceBook2 ID‘ to prepare the insert CSV file.
- Save the file in an easy-to-access location.
After the data export, follow the steps below to associate Products to the Standard Price Book via the data loader.
1. Create a CSV file with the following header columns.
- Product2ID: This is the ID of the product to be associated with the Price Book. Product ID starts with ’01t’. To get the Product ID, you can use Data Loader to export Product (Product2).
- PriceBook2ID: Get the Standard Price Book ID from the exported data CSV file.
- CurrencyIsoCode: Use this column if you have multiple currencies; otherwise, you can disregard this column.
- Unit Price: This is the List Price/Standard Price field for the Product.
- UseStandardPrice: Leave this column blank and do not map this field for the Standard Price Book.
- IsActive: TRUE (must be TRUE to insert – this can be changed to FALSE after data insertion).

2. After preparing the CSV file, open the data loader and log in with your credentials, then click on the Insert button.

3. In this step, activate the checkbox Show all Salesforce objects, select the data object Price Book Entry, and then browse the CSV file that we have created in the above steps.
After this, click on the Next button.

4. Now, the data loader will initialize the uploaded CSV file. Here, click on the OK button to proceed.
5. Now, in this step, we will map the CSV header columns with the object field names, and for that, click on the button Create or Edit a Map. Then, in the next window, click on the button Auto-Match Fields to Columns.
Now the field names will be auto-matched to the header columns, and if not, then you have to the salesforce object fields down to the column mapping.
After mapping, click on the button Save Mapping, then click on Next.

6. In this step, select the location for the error and the success files from where it can be accessed later. At last, click on the Finish button.

7. Now, we will see a warning message on the screen regarding the data insert operation. Here, click on the Yes button to proceed.

8. Now, the data import will start, and after its completion, we will get the number of successes and errors that occurred during the data import operation.
Here, we got six successes and two error messages in the dialog box. Here, we got two errors because two products were already listed in that price book. So, make sure not to repeat the listings of products to a single price book.
To close the data loader, click on the OK button.

9. Now, to view the products associated with the price books, open the Salesforce developer console and navigate to the Products tab.
Now select the product with which you have associated the price books.

Now, we can see the price books that are associated with the products. In this way, we can associate the Standard price book voa Salesforce data loader by following the above steps.
Associate Products to Custom Price Book via Data Loader
To associate products to a custom price book via data loader, follow the steps below.
1. Create a CSV file with reference to the CSV file that we created for the standard price books in the above steps. Here, change the IDs of the standard price books with the IDs of custom price books.
The field UseStandardPrice plays an important role in inserting Price Books for custom Price Books: This should be TRUE (or 1) or FALSE (or 0) and indicates whether to use the price from Standard Price Book or not.

2. Now open the data loader and click on the Insert button.
3. Activate the checkbox Show all Salesforce objects, then select the data object Price Book Entry, and then select the CSV file that we have created with the IDs of custom price books.
After this, click on the Next button.

4. In this step, create the mapping between the CSV header columns and the object field names, and to do that, click on the button Create or Edit a Map. Then, in the next window, click on the button Auto-Match Fields to Columns.
If the column headers are not auto-matched, then you have to drag the object fields down to the column mapping. After mapping, click on the OK button, then click on the Next button.

5. Select the location for the errors and successes filles from where it can be accessed later.
At last, click on the Finish button.

6. After the completion of the data insert operation, we can see the number of successes and errors in a dialog box that occurred in the data operation. Here, click on the OK button to close the data loader.

7. Now, to view the products associated with the price books, I will open the Salesforce developer console and navigate to the Price Books tab because I have assigned multiple products to a single price book.
You can also view the associated products from the Products tab.

As we can see in the above image, the products are associated with the custom price books. In this way, we can associate the products to custom price books by following the above steps.
Conclusion
In Salesforce CRM, using a data loader for associating products with standard and custom price books provides efficiency, accuracy, and scalability, making it a valuable tool for managing pricing information in a business environment.
By following the above example, you might have better understood the process of associating products with standard Price Books and custom Price Books via the Data Loader in Salesforce.
You may like to read:
- How to Insert or Update Price Books with Data Loader in Salesforce
- How to Add Standard Price to Product in Salesforce
- How to Create Custom Price Book in Salesforce
- How to Deactivate Standard Products in a Standard Price Book via Data Loader in Salesforce
- How to Create Products in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.