---
schema_version: "1"
id: 0be8fe78612e42af7fd11ad4a8db00eadcc1609a14e7b02cf3aa9486f87a843a
title: Transform Context Data Before Generating Documents
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/260-0-0/rn_sf_docgen_apex_plug_in.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_sf_docgen_apex_plug_in.htm&release=260&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cc20a496a926e6946621bb6cb699fb307edb445828803ba8ecd7a727218e1f10
description: Generate documents with clean, standardized, and business-ready data content by transforming the context data using the sample Apex plug-in. Run the Apex plug-in after context hydration to adjust formatting, grouping, string manipulation, token value changes, and other lightweight changes to meet business needs. This capability enables advanced transformation logic for scenarios that filtering alone can’t address. For example, transform flat line items into a bundle with child products so that the document shows each bundle with its related components. You can also group line items by category or region so that the document presents organized sections with related items together. Document Generation in the Omnistudio managed package doesn’t support this Apex plug-in.
products:
  - Cross Cloud Packages Solutions
release: "260"
---
# Transform Context Data Before Generating Documents

Generate documents with clean, standardized, and business-ready data content by transforming the context data using the sample Apex plug-in. Run the Apex plug-in after context hydration to adjust formatting, grouping, string manipulation, token value changes, and other lightweight changes to meet business needs. This capability enables advanced transformation logic for scenarios that filtering alone can’t address. For example, transform flat line items into a bundle with child products so that the document shows each bundle with its related components. You can also group line items by category or region so that the document presents organized sections with related items together. Document Generation in the Omnistudio managed package doesn’t support this Apex plug-in.

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

**Who:** To use an Apex plug-in with Context Service for Salesforce Document Generation, you need the DocGen Designer permission set.

#### See Also

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