415-604-1400 Call Now info@cloudyincalifornia.com
Opportunity Product Groups with No Code

Product Groups with Salesforce Flow

Opportunity Product Groups with No Code

Recently we encountered a customer who sold almost all of their products in groups or bundles. The use case was that each product could be sold individually or within a predefined group that included multiple product line items. This functionality is not included in the Salesforce Sales Cloud. However, with some creative declarative development (no code), it can be done.  The user experience is straightforward. On an Opportunity, the user adds a standard Salesforce product that represents the group. Upon save, the user immediately sees all of the products from the group automatically added to the Opportunity.

Magic? Actually, it’s a Salesforce Flow that leverages a couple of custom objects designed specifically to set up the Product Group and then creates the Opportunity Line Items using the data from the custom object records.

What it looks like

Opportunity Product Groups with No Code

Element 1: Lookup the Opportunity Line Item that is kicking off the Flow and grab the Pricebook Entry ID, the Product Group ID and the Product Group Quantity and store them in variables.

Element 2: In the second lookup, we use the Pricebook Entry from the Id stored in the variable collected at the start and grab the Pricebook Id and store it in a variable.

Element 3: Using the Id stored in a variable from the start, Fast Lookup the Group Line Items from the Product Group record to create a collection variable. This step stores the Product ID, the Quantity and Price from each Group Line Item record related to the Product Group.

Element 4: This is the loop that cycles through the Group Line Item collection variable and assigns Opportunity Line Item records to a SObject variable.

Element 5: This record lookup grabs the specific Pricebook Entry Id for each Line Item comparing the Product ID from the Group Line Item in the collection and the Pricebook ID stored from Step One.

Element 6: Now we build the Opportunity Line Items by assigning the fields identified in the Variable Collection for the Opportunity Line Item with Variables collected in the prior steps. This sets the Pricebook Entry ID from Element 5, Quantity and Price from Element 3 and the Opportunity ID from the beginning of the Flow.

Element 7: This step assigns the records created in the prior step to a new SObject Collection Variable.

Element 8: This step creates the Opportunity Line Item records using the SObject Collection Variable from Step Seven.


Custom Object: Product Group

Custom Object: Product Group Line Items

The first custom object is named Product Group. It’s a record that represents a group of products and is related to a Product Record that the user adds to kick off the automation.

Opportunity Product Groups with No Code

The second custom object is named Group Line Items. These records contain the information necessary to create the Opportunity Line Items from the Flow: Quantity, Price, and a lookup to the Product.

Opportunity Product Groups with No Code

Here we can see the Group Line Items related to the Product Group Record.

Opportunity Product Groups with No Code

The last part of the set up is creating a Product record that has a lookup to the Product Group record. This is how we provide the user with a way to add the Product Group to the Opportunity and set the Pricebook information that is used in the Flow.

Opportunity Product Groups with No Code

The User Experience


In the example, the user wants to add the 2 Diesel generator with portable installation and the Gold SLA. Instead of adding three different products to this Opportunity, the user will only have to add one.

Opportunity Product Groups with No Code

The user clicks Add Products.

The user selects the Product that represents the desired group.

Opportunity Product Groups with No Code

The user edits the products

Opportunity Product Groups with No Code

Note: We’re leaving the price at $0 because the Product Group Line Items dictate the Price and Quantity for each individual item in the Group. You can configure it the opposite way where the Group Line Item records have no price and the Product that represents the group has the Price. Also the Quantity here will affect the quantity of the line items added. If you put two of this product, each line item quantity will double. Since this is a 2 Diesel product group there are two Diesel Generators in the group. If a user selects this Product and changes the Quantity to 2, then 4 Diesel Generators will be added to the Opportunity.


After the user clicks Save on the Edit Products Screen – BAM! The magic happens. Each item from the Product Group was added to the Opportunity by the Flow as detailed in the Group Line Items.

Opportunity Product Groups with No Code



801 10th Street – 5th Floor Modesto,California