Document Generation Widget
The CloudFiles Document Generation is used to generate DOCX and PDF documents using Salesforce data. It integrates directly within Salesforce record pages, displaying all published templates related to a specific object. Users can select a template, generate a document, and download it in DOCX or PDF format. This functionality relies on the CloudFiles Word Add-in, which is used to design and manage document templates with Salesforce fields, and must be connected to your Salesforce Org for full functionality.
After setting up the CloudFiles Word Add-in, the Document Generation Widget can be configured within Salesforce using the Lightning App Builder. The widget supports several configuration options -
- Widget Placement: You can add the widget to any record detail page, making it accessible directly from relevant Salesforce objects.
- Template Display: The widget automatically pulls in and displays all published templates related to the specific Salesforce object, allowing users to select the appropriate template quickly.
- Document Settings: Users can choose between DOCX and PDF output formats when generating documents.
- Automatic Download: Once a document is generated, it is automatically downloaded to the user's device.
- Field Mapping: Templates created using the Word Add-in are dynamically populated with Salesforce data based on field mappings configured within the template.

The CloudFiles Doc Gen LWC can be easily added to any object's record detail page in Salesforce. Once added, this widget will display all the published templates related to that object. Users can then generate documents in either DOCX or PDF format, which will be automatically downloaded upon generation.
Follow the steps below to add CloudFiles Doc Gen widget to any page -
- Go to any Object's record detail page and click “Edit Page” Button.
- Lightning builder for this page will open. Drag and drop the "CloudFiles Doc Gen" widget into the desired location.
- Save and exit the builder.
- Refresh the Salesforce record page.
- The widget displays all the published templates for that object.
For visual understanding, refer to the video below -
For more details, please refer to detailed guide on Document Generation .