---
schema_version: "1"
id: 9b5215c5b19120cae13885a9a8316d667cfbdae840d1de9271215733738d7ef4
title: Generate Documents with Hierarchical Bundles and Grouped Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/262-0-0/rn_sf_docgen_heirarchicalbundles_and_grouped_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_sf_docgen_heirarchicalbundles_and_grouped_data.htm&release=262.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d95548b8d130dfcaa25a9bc8ddc2fe07dd7bf4fa94d072d9b9a008a239fe412d
description: Transform data to capture hierarchical relationships, groupings, and calculated values in generated documents. For example, build nested product bundles and organize quote line groups with their associated line items for a clearer document output. Apply grouping logic, such as grouping by selling model, price range, or quantity conditions, to present data in meaningful sections. Apply formulas to derive calculated values. Improve document accuracy by using Context Services and Data Processing Engine (DPE) to process large datasets.
products:
  - Cross Cloud
release: "262"
---
# Generate Documents with Hierarchical Bundles and Grouped Data

Transform data to capture hierarchical relationships, groupings, and calculated values in generated documents. For example, build nested product bundles and organize quote line groups with their associated line items for a clearer document output. Apply grouping logic, such as grouping by selling model, price range, or quantity conditions, to present data in meaningful sections. Apply formulas to derive calculated values. Improve document accuracy by using Context Services and Data Processing Engine (DPE) to process large datasets.

**Where:** This change applies to Lightning Experience in Enterprise, Performance, Unlimited, and Developer editions of Agentforce Revenue Management, formerly Revenue Cloud, with the Revenue Events Starter Pack license, and the Revenue Cloud Advanced or Revenue Cloud Billing license.

**Who:** To use Context Service and DPE in Salesforce Document Generation, users need the DocGen Designer permission set or DocGenPlus permission set license.

**Why:** Complex Revenue Management scenarios require documents to reflect real-world structures such as nested product bundles, hierarchical quote groups, and business-driven groupings. Flat JSON output doesn’t represent these relationships effectively, making documents harder to interpret. You can transform data by using DPE to restructure hierarchical data, such as Quote, QuoteLineGroups, QuoteItems, into hierarchical and grouped formats. The transformation accurately renders bundle relationships, group hierarchies, and conditional groupings before document generation.

**How:** Configure context definitions with transformation logic for hierarchy, grouping, formulas, and default values. Define grouping criteria and apply calculations as needed. Associate the transformation with the document template to render the structured output.

#### See Also

- [_Salesforce Help_: Transform Context Data for Document Generation](https://help.salesforce.com/s/articleView?id=ind.sf_docgen_ctxtransform_overview.htm&type=5&language=en_US)