View this page in the latest version of Appian. Document Generator Share Share via LinkedIn Reddit Email Copy Link Print On This Page The capabilities described on this page are included in Appian's advanced and premium capability tiers. Usage limits may apply. This page describes Document Generator, which is an Advanced Plug-in developed, managed, and maintained by Appian. What is Document Generator? Document Generator automates document creation by combining styled document templates with structured, dynamic data. You design a Word (.docx) or PowerPoint (.pptx) template once, place markup tags and visual placeholders where dynamic content belongs, and the plug-in populates those placeholders at runtime while preserving the template's typography, colors, layout, and visual design. Document Generator keeps document design separate from application logic. Templates contain no business logic or conditional scripts. You prepare and format all data in an expression using a library of tag-specific SAIL helper functions, then pass the data to a smart service that generates the finalized document. Document Generator is ideal for creating invoices, dynamic reports, personalized customer communications, financial statements, executive briefing decks, and other business documents that require dynamic content and consistent formatting. Features Document Generator provides the following capabilities: Style preservation: All formatting applied to a template tag—including fonts, colors, text alignment, margins, and inline styling—is preserved in the generated document. Logic separation: Templates contain no business logic. You handle all data transformation and formatting in a SAIL expression before populating the template through a smart service. Strict data validation: Mark tags as required to enforce critical data delivery. The Document Generator smart service validates the data payload and halts generation with a descriptive error if a required field is missing. Rich media placeholders: Beyond text substitution, Document Generator supports dynamic placeholders for images, data tables, charts, HTML, links, sections, and page breaks. Path traversal: Access nested object properties and array items directly within tag names using dot-notation indexing syntax. Helper functions: A library of tag-specific helper functions handles data preparation, dynamic table binding, and image and chart sizing before generating. Supported file formats The Document Generator smart services support the following file formats: Format Supported .docx .doc .pptx .ppt .xlsx .xls .pdf Installation Appian Cloud customers: Appian Cloud customers on the advanced and premium capability tiers can download this plug-in directly from the Plug-ins section of the Admin Console. Self-managed customers: Self-managed customers on the advanced and premium capability tiers can download this from the Downloads section of MyAppian. Recommendations Follow these recommendations to get the best performance from Document Generator. Enable Autoscale or increase heap size For use cases that involve large documents, high-volume generation, or many concurrent document generation workflows, Appian recommends using Autoscale. Document Generator is enabled for Autoscale usage on sites running Appian 26.6 and later. For earlier versions, submit a support case requesting enablement of this plug-in within Autoscale processes. If your site doesn't have Autoscale enabled, contact your Appian representative to request access. If your site isn't enabled for Autoscale, make sure it has at least 5 GB of heap memory configured. To increase your site's heap memory, submit a support case. Use with Microsoft Document Editor Pair Document Generator with the Microsoft Document Editor plug-in to build a complete document workflow inside Appian. Microsoft Document Editor supports real-time collaboration on Word, Excel, and PowerPoint files, so multiple users can concurrently view and edit the same document. With both plug-ins, you can build and refine templates, configure your data, test the output, and make final edits to generated documents without switching tools. To get started, confirm that your enterprise has Microsoft licenses and that your site meets the Microsoft Document Editor requirements. Then follow the installation instructions to request access to the plug-in. Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to close How Document Generator works Generating a document involves the following steps: Design the template. Create your document in a word processor or Microsoft Document Editor. Place delimiters around tag names, set the exact styles, sizes, and colors you want in the output, and follow the required syntax and naming conventions. For details, see Design the template. Prepare the schema. Configure the template within the Document Generation Assistant component or the docgentemplateschemaexpression() function to generate a baseline schema that matches the template's tags. For details, see Prepare the schema. Configure the schema. Use tag-specific helper functions in your expression to format the input data for each placeholder type, including text, HTML, links, page breaks, images, tables, charts, sections, and required tags. For the syntax and an example for each type, see Configure the schema. (Optional) Test the template with the Assistant. If you want to inspect tags, validate your data, and generate a sample document without leaving the interface designer, use the Document Generation Assistant component. For details, see Test templates with the Document Generation Assistant. Generate the document. Configure the Docx Generator or Pptx Generator smart service with the template document, the schema expression rule, and the output destination. For all parameters, see Generate the document with a smart service. Design the template Note: You can use the Microsoft Document Editor plug-in to create and edit document templates directly within Appian. In a word processor or Microsoft Document Editor, create a template with dynamic fields. To support data binding and document parsing, all dynamic fields in a template must follow specific syntax and naming constraints. Tag structure Each tag follows this structure: 1 {{ [prefix]tag_name[suffix] }} Start delimiter: {{ End delimiter: }} Certain tags require a prefix immediately after the opening delimiter to denote the expected data type: Prefix Tag type $ HTML @ Link ! Page break # Open section / Close section Certain tags require a suffix immediately before the closing delimiter to denote the expected data type: Suffix Tag type * Triggers data population. When you generate the document, the Document Generation smart service checks for the existence and validity of data for all required tags. If a required tag is missing from the data payload, null, or undefined, generation halts and raises a validation error that specifies the missing tag. Tag naming rules To maintain syntax integrity, tag names must observe the following rules: Allowed characters. English alphabet characters (a-z, A-Z), underscores (_), and the period (.). The period is reserved for dot traversal. No whitespace. Whitespace is not permitted anywhere inside a tag name. For example, {{ user_name }} and {{user name }} are invalid. Use {{user_name}}. Case sensitivity. Tag names are case-sensitive. {{user_name}} and {{User_Name}} refer to distinct data attributes. Tag compatibility Tag type support varies by file format and document element, so check the following tables before you add a tag to a template. Supported tag types by template The following table shows which tag types are supported in Word (.docx) and PowerPoint (.pptx) templates: Tag type Notation .docx .pptx Text {{tag}} Link {{@tag}} Page break {{!tag}} HTML {{$tag}} Table {{tag}} in alt text Image {{tag}} in alt text Chart {{tag}} in alt text Section {{#tag}}, {{/tag}} Element compatibility in Word templates The following table shows which tag types are supported in each element of a .docx template: Element Text Link Table Image Chart Page break HTML Section Body Header and footer Footnote and endnote Table cell Element compatibility in PowerPoint templates The following table shows which tag types are supported in each element of a .pptx template: Element Text Link Table Image Chart Page break HTML Section Slide body Speaker notes Table cell Prepare the schema A template's schema is the input map (a!map()) that supplies the data for each tag during generation. Rather than build this map by hand, generate a baseline schema from the template itself, so you can configure it to meet your organization's needs. To generate a baseline schema, we recommend using the Document Generation Assistant. Simply add the Assistant to a test interface, point it at your template, and use the Copy schema button on the Tags tab. Alternatively, you can use the docgentemplateschemaexpression() function instead: In an expression rule, configure docgentemplateschemaexpression() with the template document. Click TEST EXPRESSION, then copy the output. The output shows the structure of the data to pass in during generation. On the Raw tab, copy the output schema string and paste it into an expression rule. Then press Format or use the keyboard shortcut (Ctrl+Shift+F). On the Formatted tab, copy the output schema string and paste it into an expression rule. Remove the opening and closing quotation marks, then press Format or use the keyboard shortcut (Ctrl+Shift+F). Caution: Do not copy from the Expression tab or use Copy Expression. This inserts unnecessary quotation marks and slows down configuration. Configure the schema After you generate the baseline schema, set the value for each tag. The format of each value depends on the tag's placeholder type. Document Generator supports several placeholder types—such as text, HTML, links, images, tables, and charts—and each one uses a specific tag syntax in the template and a corresponding data format in the schema. The following sections describe the syntax, template setup, and input data for each type. Note: Do not use the same tag name for multiple types of tags. For example, if the template contains {{tag_name}}, do not also use {{!tag_name}}, {{$tag_name}}, or {{@tag_name}}, or reuse tag_name in the alt text description for an image, table, or chart. Text injection Text injection replaces a placeholder with a text value at generation time. The injected text inherits the template tag's styling—including bold, italic, underline, strikethrough, font size, color, and font family—by default. Syntax Use the {{placeholder}} syntax in the template. Template The following template shows the styled placeholder: Input data Provide a plain text value in the data: 1 2 3 4 a!map( user_name: "John Smith", company: "Appian" ) Generated output The generated document replaces the placeholders with the input values: Best practices Follow these best practices for text injection: Use plain text values when the template's own formatting is sufficient. Use docgentexttag() only when formatting needs to vary based on runtime data. Choose font families that are available in the target Word environment to ensure consistent appearance. Keep placeholder names descriptive and aligned with the corresponding input data keys. Dynamic text injection Dynamic text injection controls text styling—such as bold, italic, font size, color, and font family—through input data at runtime. You can also use this function to style tables and links. Template The following template shows the placeholder: Input data Use the docgentexttag() helper function to style text conditionally based on the data: 1 2 3 4 5 6 7 8 9 10 11 a!map( reason: "Project xyz phase 3 research.", amount: "$100000", status: docgentexttag( text: "Approved", bold: true, fontSize: 16, color: "008000", fontFamily: "Calibri" ) ) Generated output The generated document applies the runtime styling: HTML injection HTML injection inserts HTML content into a document at generation time. This is useful when document content originates from a rich text editor that produces HTML output. The template engine interprets the HTML and renders formatted content directly in the generated document. Headings, paragraphs, and other supported HTML elements map to their corresponding Word styles. Note: HTML insertion is available only for Microsoft documents. If the document is later converted to Google Docs or another format, the inserted HTML may not render properly. Caution: The following HTML tags are not supported: script, iframe, form, object, embed and img. Syntax Use the $ prefix inside the delimiters: {{$placeholder}}. Template The following template shows the placeholder: Input data Provide an HTML string in the data: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 a!map( executive_summary: "<h2>Quarter 1 at a Glance</h2>" & "<p>Acme finished Q2 <strong>17% above plan</strong>, driven by the " & "<em>Phoenix Migration</em> go-live and expansion into two new regions.</p>" & "<ul>" & "<li>Net revenue retention: 121%</li>" & "<li>Platform availability: 99.97%</li>" & "<li>Two executive sponsors added to steering committee</li>" & "</ul>" & "<p>Focus for Q3 shifts to <strong>cost-to-serve optimization</strong> and the " & "APAC rollout readiness assessment.</p>" ) Generated output The generated document renders the HTML as formatted content: Styled text editor integration You can compose formatted text using the a!styledTextEditor component, which produces an HTML string that you can pass directly to the template engine without additional conversion. The generated document preserves user formatting such as text alignment, bold, italics, strikethroughs, lists, hyperlinks, and more. Section injection A section is a defined region in a template that controls whether a block of content is displayed, removed, repeated, or dynamically populated based on the data provided at generation time. Sections are useful for conditional content, optional paragraphs, repeating records, and nested object data represented as maps. Syntax Open a section with the # prefix and close it with the / prefix: 1 2 3 4 {{#section}} {{optional_tag}} Optional text. {{/section}} Template The following template shows the section in a document: The section contains a block of text and placeholders: Section values The value you provide for the section determines the behavior: Section value Behavior false or null The entire section region is removed, like a cut operation. true The section region is retained as-is. Nested placeholders remain unresolved because no map context is provided. A map The section region is retained and nested placeholders are resolved using values from the map. A list of maps The section region repeats once for each item in the list. Each iteration uses the corresponding map as the context for resolving nested placeholders. Remove the section (false or null) When the section value is false or null, the entire section region is removed. This behaves like a cut operation: everything inside the section markers is excluded from the final document. 1 2 3 a!map( orderConfirmation: false ) Keep the section unchanged (true) When the section value is true, the section region is retained as-is. Placeholders remain unresolved because no map context is provided. This is useful for conditionally inserting or removing blocks of non-tagged text. If the section contains tags, the tags remain unaltered. 1 2 3 a!map( orderConfirmation: true ) Resolve placeholders from a map When the section value is a map, the section region is retained and the nested placeholders are resolved using values from that map. 1 2 3 4 5 6 a!map( orderConfirmation: a!map( orderId: "ORD-78542", deliveryDate: "July 3, 2026" ) ) Repeat the section for a list of maps When the section value is a list of maps, the section region repeats once for each item in the list. Each iteration uses the corresponding map as the context for resolving the nested placeholders. 1 2 3 4 5 6 a!map( orderConfirmation: { a!map(orderId: "ORD-78542", deliveryDate: "July 3, 2026"), a!map(orderId: "ORD-78543", deliveryDate: "July 5, 2026") } ) Link injection Link injection inserts a clickable hyperlink into a document. During generation, the placeholder is replaced with the hyperlink defined in the input data. Syntax Use the @ prefix inside the delimiters: {{@placeholder}}. Template The following template shows the placeholder: Input data Use docgenlinktag() to define the target URL and the display text: 1 2 3 4 5 6 a!map( receipt: docgenlinktag( url: "https://www.appian.com", displayName: "Click Me" ) ) Generated output In the generated document, "Click Me" renders as a clickable hyperlink that points to https://www.appian.com. The generated document shows the hyperlink: Note: If the URL does not include a valid protocol such as https://, the hyperlink is not considered valid for injection. Page break injection Page break injection inserts a page break at generation time. This is useful when the placement of content depends on runtime data—for example, when you want to start a new page only when a particular section is present. Syntax Use the ! prefix inside the delimiters: {{!break_page}}. The page break is inserted only if the corresponding input value evaluates to true: Value Behavior true Inserts a page break. Content that follows the placeholder begins on a new page. false No page break is inserted. Content that follows the placeholder continues on the same page. Template The following template shows the page break placeholder: Input data Provide the page break value in the data: 1 2 3 4 5 a!map( employee_name: "John Smith", employee_department: "IT", break_page: true ) Generated output When the page break value is true, the content after the placeholder begins on a new page. Page 1: Page 2: When the page break value is false, the content after the placeholder continues on the same page. Image injection Image injection replaces a placeholder image in a document at generation time. Use the docgenimagetag() function to specify the image to insert, along with its alt text and sizing. Syntax To configure an image placeholder: Insert an image into the template where the dynamic image should appear. Open the image's Alt Text properties. Set the Alt Text Description to an image placeholder using the {{placeholder}} syntax. Set the placeholder in the Alt Text Description field, not in the Alt Text Title field. Template The following template shows the placeholder image: Input data At runtime, the system identifies the template image using this placeholder and replaces it with the image provided in the input data: 1 2 3 4 5 6 7 8 a!map( logo: docgenimagetag( image: cons!POINTER_TO_IMAGE_DOCUMENT, altText: "Company Logo", markAsDecorative: false, imageSize: "CONTAIN" ) ) Generated output The generated document shows the inserted image: Note: If the template image was inserted using the Online Pictures option, image replacement may not work as expected. Table injection Table injection populates a template table at runtime using structured input data. The generated table inherits the formatting and styling of the template table while inserting dynamic rows and columns based on the provided data. Syntax To configure a table placeholder: Insert a table into the template and apply all desired table formatting and styling. Open the table's Alt Text settings. Set the Alt Text Description to the table tag. Set the placeholder in the Alt Text Description field, not in the Alt Text Title field. Template The following template shows the placeholder table: Input data Use docgentabletag() to provide the headers and rows: 1 2 3 4 5 6 7 8 9 10 a!map( data_table: docgentabletag( headers: { "Region", "Revenue", "Target", "Growth" }, rows: { a!map("Region": "North America", "Revenue": "$1,250,000", "Target": "$1,100,000", "Growth": "18%"), a!map("Region": "Europe", "Revenue": "$980,000", "Target": "$900,000", "Growth": "15%"), a!map("Region": "Asia Pacific", "Revenue": "$1,420,000", "Target": "$1,300,000", "Growth": "22%") } ) ) Generated output The generated document shows the populated table: Column behavior during generation follows these rules: If the template table contains fewer columns than the number of headers in the input data, additional columns are created dynamically. If the template table contains more columns than the number of headers in the input data, the extra columns are removed. If a row map does not contain a value for one of the defined headers, that cell is left empty. Note: Dynamic rows and columns follow the template table's styling. Set table styling on the Table tab in Microsoft Office. Chart injection Chart injection populates a chart in a template while preserving the chart's existing formatting and styling. Design the chart directly in Microsoft Word using the chart type, colors, fonts, legends, and axis formatting you want. During generation, only the underlying chart data is replaced. Limitations Charts are not supported in document headers and footers. You cannot insert or edit charts using the Microsoft Document Editor plug-in, due to limitations with Microsoft Office Online. To create templates that include charts, use the desktop version of Microsoft Office. Recommendations Charts in AI-generated templates often use unexpected structures that can cause generation to fail. If you use an AI tool to produce a template, manually insert and configure the charts in the desktop version of Microsoft Word instead of relying on the AI-generated charts. Syntax To configure a chart placeholder, insert a chart into the template, apply the formatting you want, then set the chart's Alt Text Description to the chart tag. Template The following template shows the placeholder chart: Input data Document Generator supports three categories of chart data: Chart data type Supported Word charts Function Category series Bar, Column, Line, Area, Radar, Surface docgencategoryseriesdata() Category value Pie, Doughnut docgencategoryvaluedata() Scatter XY Scatter, Bubble docgenscatterdata() Use docgencharttag() with the chart data function that matches your chart type: 1 2 3 4 5 6 7 8 9 10 11 12 a!map( column_chart: docgencharttag( data: docgencategoryseriesdata( categories: { "Q1", "Q2", "Q3", "Q4" }, series: a!map( "2024": a!map("Q1": 120, "Q2": 180, "Q3": 160, "Q4": 220), "2025": a!map("Q1": 140, "Q2": 200, "Q3": 190, "Q4": 250) ) ), altText: "Quarterly Sales" ) ) Generated output The generated document shows the populated chart: Nested tag injection Nested tag injection uses dot notation to organize related tags into logical groups. Instead of managing a long, flat list of tag names, you can group tags under a shared parent name. This keeps templates easier to read and keeps the input data organized to match the structure of the document. Syntax Use dot notation in the template: 1 2 Lead: {{account_team.lead_name}} Manager: {{account_team.delivery_manager}} Template The following template shows the dot-notation placeholders: Input data Structure the data to match: 1 2 3 4 5 6 7 a!map( account_team: a!map( lead_name: "Sarah Chenning", delivery_manager: "Rahul Mehta", escalation_phone: "+1 (571) 555-0142" ) ) Generated output The generated document shows the resolved values: Note: Unlike section injection, nested tag injection does not support looping or conditional sections. Test templates with the Document Generation Assistant The Document Generation Assistant (DocGenAssistantField) is a component that helps you design, validate, and test document generation templates directly in the interface object. The Assistant complements the Document Generator smart service and helper functions with a visual workspace where you can: Inspect template tags: View every tag grouped by type and copy a ready-to-use schema expression. Validate template and data compatibility: Identify invalid tags, unused tags, and unused data before you generate a document. Test document generation: Generate a sample document on demand and review its generation time and memory usage. To get started, add the component to a test interface and connect it to your template and data. As you refine your template, use the Assistant to check for issues, preview results, and iterate quickly. Assistant features The Document Generation Assistant provides the following capabilities: Tag inspection: See all {{tag_name}} placeholders discovered in your template, organized by tag type. One-click schema copy: Copy the full schema expression, or just the required-tags schema, to your clipboard to paste into an expression rule. Live validation: Compare your template against sample data to surface invalid tags, unused tags, and unused data fields. Sample generation: Produce a document from the template and your data, then download it directly from the component. Performance metrics: After generating, view the time taken and memory allocated so you can plan heap sizing for larger documents. Add the Assistant to an interface To configure the Document Generation Assistant: In the interface object, search the palette for the Document Generation Assistant (DocGenAssistantField) component and drag it onto your interface. Configure the component parameters. Point it at your template document and, optionally, your data, delimiters, and a save location. For all parameters, see Assistant parameters. Open the interface and use the Tags, Validate, and Generate tabs to inspect, validate, and test as you refine your template. (Optional) If you want to edit templates or the generated documents without leaving Appian, configure the Microsoft Document Editor plug-in alongside the component. Assistant parameters The Document Generation Assistant accepts the following parameters: Parameter Type Required Description templateDocumentId Document Yes The .docx or .pptx template to inspect and validate. Required for the Tags and Generate tabs. data Map No The data you intend to populate the template with. Used by the Validate tab and required for the Generate tab. saveGeneratedDocumentTo Document or Folder No Where a generated sample document is saved. Required for the Generate tab. generatedDocumentSaveInto Save Into No Where to save the ID of the generated document. startDelimiter Text No A custom opening delimiter for tags. Defaults to {{. If you set this, you must also set endDelimiter. endDelimiter Text No A custom closing delimiter for tags. Defaults to }}. Assistant panel The component renders as a fixed-height panel with a tab bar across the top and a Reload button on the right. The Reload button refetches or resets whichever tab is currently active. The panel has the following tabs: Tags: Inspect the tags in your template. Validate: Check your data against the template. Generate: Produce and download a sample document. Tags tab The Tags tab reads your template and lists every placeholder it finds, grouped by tag type. Use it to understand the shape of the data your template expects and to copy a schema expression. This tab requires a valid templateDocumentId. To copy the schema, click Copy schema. This action copies a preconfigured schema expression that you can use as a starting point for the expression rule that supplies data to your document. Validate tab The Validate tab compares the tags in your template against the data parameter and reports any mismatches, so you can fix problems before generating. It presents the results as a searchable view. The tab reports the following categories: Category Meaning Invalid tags Template tags that don't follow the supported tag syntax. Unused tags Template tags with no matching field in the data. Unused data Data fields that aren't referenced by any template tag. This tab requires a non-empty data parameter. If data is missing, the tab shows a prompt to configure it. Validation is not possible until data is present. Generate tab The Generate tab produces a document from your template and data and lets you download it immediately. Generation runs only when you click Generate. It never runs automatically on load or re-evaluation. This tab requires both saveGeneratedDocumentTo and data. Until both are set, the tab shows guidance on which inputs to configure and the Generate button stays disabled. Before generating, you can provide the following inputs: Generated document name. Optional if saveGeneratedDocumentTo is a document. Required if saveGeneratedDocumentTo is a folder. Generated document description. Optional. After generating, the tab shows: A download link for the generated document, plus a Copy link button. The generated document ID, with a copy button. Performance metrics for time taken, in milliseconds, and memory allocated, in megabytes. Memory allocated shows N/A when the runtime can't report it. Reload and sync behavior The Reload button behaves differently on each tab: On the Tags tab, Reload reruns tag categorization. On the Validate tab, Reload reruns document validation. On the Generate tab, Reload resets the form and clears the previous result without generating a new document. Note: After you edit a template in Microsoft Document Editor, changes may take 30 seconds to 2 minutes to sync to the Appian template document. The document viewer does not refresh automatically. Once changes sync, reload the browser tab to refresh both the document viewer and the Assistant, or click Reload in the Assistant to refresh only that component. Generate the document with a smart service Note: If Track Changes is enabled in the template document, accept or reject all changes before generation. After you design a template and format the data schema, configure the Document Generation smart service appropriate to the document format to produce the output. Document Generation smart services include: Smart Service Use to Generate Docx Generator .docx documents Pptx Generator .pptx documents Input parameters Parameter Type Description Template Document Id Document The Word or PowerPoint template document to process. Data Map The input data used to populate the template. Save Generated Document To Document or Folder Where to save the generated document. If set to a document, that document is overwritten as a new version. If set to a folder, a new document is generated and Generated Document Name is required. Generated Document Name Text The name of the generated document. Generated Document Description Text The description of the generated document. Start Delimiter Text The custom starting delimiter to use for all template tags. End Delimiter Text The custom ending delimiter to use for all template tags. Generated document parameters Parameter Type Description Generated Document Document The generated document produced after processing the template. Configuration notes The template document provided to the Document Generation smart service must be a valid Word .docx or PowerPoint .pptx file. If you provide Start Delimiter, you must also provide End Delimiter. For example, [[ and ]] is a valid pair. The process or user that runs the Document Generation smart service must have sufficient permissions to read the template document and write to the configured output destination. Functions Document Generator provides two groups of functions: tag builder functions that configure input data for generation, and helper functions that generate and validate a template's schema. Tag builder functions Use the following functions in an expression to configure input data for generation: Function Description docgentexttag() Creates styled text with optional bold, italic, underline, strikethrough, font size, color, and font family. docgenlinktag() Creates a hyperlink from a URL and optional display text. docgenimagetag() Creates an image reference with alt text and sizing options. docgencharttag() Creates a chart from chart data with optional accessibility settings. docgencategoryvaluedata() Creates category-value chart data for pie and doughnut charts. docgencategoryseriesdata() Creates category-series chart data for bar, column, line, area, radar, and surface charts. docgenscatterdata() Creates scatter chart data for XY and bubble charts. docgentabletag() Creates a table from headers, rows, and optional settings. docgendocxtablesettings() Configures DOCX table settings such as header repetition and column auto-fit. docgenpptxtablesettings() Configures PPTX table accessibility text. docgentexttag() Creates a styled text input structure for document generation. Accepts text content along with optional formatting properties such as bold, italic, underline, strikethrough, font size, color, and font family. Parameter Type Required Description text Text Yes The text content to display in the generated document. bold Boolean No Whether the text is bold. Defaults to the template's existing style if not provided. italic Boolean No Whether the text is italicized. Defaults to the template's existing style if not provided. underline Boolean No Whether the text is underlined. Defaults to the template's existing style if not provided. strikethrough Boolean No Whether the text has a strikethrough. Defaults to the template's existing style if not provided. fontSize Number (Integer) No The font size for the text in points. Defaults to the template's existing style if not provided. color Text No The color of the text as a hex color string, such as "FF0000" for red. Defaults to the template's existing style if not provided. fontFamily Text No The font family name for the text, such as "Arial" or "Times New Roman". Defaults to the template's existing style if not provided. docgenlinktag() Creates a hyperlink input structure for document generation. Parameter Type Required Description url Text Yes The URL for the hyperlink. Must be a valid URL with protocol and host, such as https://www.appian.com. displayName Text No The visible text displayed for the hyperlink. If not provided, the URL itself is used as the display text. docgenimagetag() Creates an image input structure for document generation. Validates the image document reference and allows optional accessibility settings, including alternative text and marking the image as decorative. Parameter Type Required Description image Document Yes An Appian Document constant or ID that points to a valid image file. Supported formats are PNG, JPG, JPEG, and SVG. imageSize Text No The size of the injected image. Accepts "CONTAIN" (fit proportionally within the template dimensions), "COVER" (fill the template dimensions and center-crop overflow), "FILL" (stretch to the template dimensions), or "NONE" (use the image's native DPI-based dimensions, defaulting to 96 DPI). Defaults to "CONTAIN". altText Text No Alternative text for the image, used for accessibility. When markAsDecorative is true, this value is ignored. markAsDecorative Boolean No Whether to mark the image as decorative. When true, the image is marked as decorative and alt text is cleared. docgencharttag() Creates a chart input structure for document generation. Validates the chart data and allows optional accessibility settings, including alternative text and marking the chart as decorative. Parameter Type Required Description data Any Type Yes The chart data configuration. Use docgencategoryseriesdata() for bar, column, line, area, radar, and surface charts, docgencategoryvaluedata() for pie and doughnut charts, or docgenscatterdata() for XY and bubble charts. chartTitle Text No Title of the chart. altText Text No Alternative text for the chart, used for accessibility. When markAsDecorative is true, this value is ignored. markAsDecorative Boolean No Whether to mark the chart as decorative. When true, the chart is marked as decorative and alt text is cleared. docgencategoryvaluedata() Creates category-value chart data for pie and doughnut charts, to be used as the data parameter in docgencharttag(). Parameter Type Required Description data Any Type Yes A map where each key is a category label (Text) and each value is a number representing the value for that category slice. Template Input data 1 2 3 4 5 6 7 8 9 10 11 12 13 14 a!map( fee_allocation_chart: docgencharttag( data: docgencategoryvaluedata( data: a!map( "Implementation": 420000, "Licenses": 310000, "Managed Services": 265000, "Support": 120000, "Training": 45000 ) ), altText: "Annual Fee Allocation" ) ) Generated output docgencategoryseriesdata() Creates category-series chart data for bar, column, line, area, radar, and surface charts, to be used as the data parameter in docgencharttag(). Parameter Type Required Description categories List of Text Yes A list of text values representing the category labels along the chart axis, such as month names or product names. series Any Type Yes A map where each key is a series name (Text) and each value is a map of category-to-number mappings. Each inner map should have keys that match the provided categories and numeric values. Template Input data 1 2 3 4 5 6 7 8 9 10 11 12 a!map( quarterly_revenue_chart: docgencharttag( data: docgencategoryseriesdata( categories: { "Q1", "Q2", "Q3", "Q4" }, series: a!map( "2025": a!map("Q1": 120, "Q2": 240, "Q3": 305, "Q4": 405), "2026": a!map("Q1": 810, "Q2": 840, "Q3": 820, "Q4": 6190) ) ), altText: "Quarterly Revenue ($K)" ) ) Generated output docgenscatterdata() Creates scatter chart data to be used as the data parameter in docgencharttag(). Parameter Type Required Description data Any Type Yes A map where each key is a series name (Text) and each value is a list of point maps representing the data points for that series. Template Input data 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 a!map( risk_exposure_chart: docgencharttag( data: docgenscatterdata( a!map( "Cyber": { a!map(x: 4, y: 5, size: 40), a!map(x: 3, y: 4, size: 25) }, "Financial": { a!map(x: 2, y: 4, size: 18), a!map(x: 3, y: 3, size: 22) }, "Operational": { a!map(x: 4, y: 2, size: 15), a!map(x: 2, y: 2, size: 10) } ) ), altText: "Likelihood vs Impact" ) ) Generated output docgentabletag() Creates a table input structure for document generation. Accepts table headers, rows, and an optional settings configuration. Parameter Type Required Description headers Any Type Yes A list of text values representing the column headers for the table. rows Any Type Yes A list of maps representing the table rows. Each map entry should have a key that matches one of the header names and a value for the cell content. settings Any Type No Optional table settings. Use docgendocxtablesettings() or docgenpptxtablesettings() to configure this parameter. docgendocxtablesettings() Creates a DOCX table settings configuration to be used as the settings parameter in docgentabletag(). Configures accessibility text, header repetition, and column auto-fit behavior. Parameter Type Required Description altTextTitle Text No Alternative text title for the table, used for accessibility. altTextDescription Text No Alternative text description for the table, used for accessibility. repeatHeaderOnPageBreak Boolean No Whether to repeat the header row at the top of each page when the table spans multiple pages. autoFit Text No Accepts "AUTO-FIT-CONTENTS" (columns fit their content), "AUTO-FIT-WINDOW" (table stretches to fit the page width), or "FIXED-COLUMN-WIDTH" (columns maintain fixed widths). docgenpptxtablesettings() Creates a PPTX table settings configuration to be used as the settings parameter in docgentabletag(). Configures the accessibility text for the table. Parameter Type Required Description altTextTitle Text No Alternative text title for the table, used for accessibility. altTextDescription Text No Alternative text description for the table, used for accessibility. Helper functions Use the following functions to generate and validate a template's schema: Function Description docgentemplateschemaexpression() Inspects a template and generates a baseline schema expression for its tags. docgenvalidatetemplatedata() Validates a template's tags against the provided data before generation. docgentemplateschemaexpression() Inspects a target template document, extracts all placeholder tags, and generates a baseline expression to use in the Document Generation smart service. This function streamlines developer workflows, reduces manual mapping errors, and accelerates the setup of the data structures required for generation. Common scenarios include: Bootstrapping initial input maps for new templates. Auditing existing templates to identify added or removed placeholders. Creating dynamic configuration interfaces that map Appian process data to document tags. Generating default template schema expressions for automated generation pipelines. Parameter Type Required Description templateDocument Document Yes The Appian Document object that contains the template file to parse. startDelimiter Text Yes The opening delimiter string used to identify tags, such as "{{". endDelimiter Text Yes The closing delimiter string used to identify tags, such as "}}". Example: 1 2 3 4 5 docgentemplateschemaexpression( templateDocument: cons!ONBOARDING_DOCUMENT_TEMPLATE, startDelimiter: "{{", endDelimiter: "}}" ) docgenvalidatetemplatedata() Validates the relationship between a template and the data provided for generation. Analyzes the tags defined in the template and compares them with the fields available in the data. Use this function to identify invalid tags, unused template tags, required tags that do not have corresponding data, or data fields that the template does not use. Parameter Type Required Description templateDocument Document Yes The template document to validate. data Any Type Yes The data provided for populating the template. analyze Text No The type of validation to perform. Accepts "ALL", "INVALID_TAGS", "UNUSED_TAGS", "UNUSED_REQUIRED_TAGS", or "UNUSED_DATA". startDelimiter Text No The starting delimiter used to identify template tags. endDelimiter Text No The ending delimiter used to identify template tags. The analyze parameter determines what type of validation is performed: Value Description "ALL" Performs all available validation checks and returns details for all identified issues. "INVALID_TAGS" Identifies tags in the template that are invalid according to the supported tag syntax. "UNUSED_TAGS" Identifies tags in the template that do not have a corresponding field in the data. "UNUSED_REQUIRED_TAGS" Identifies required tags in the template that do not have corresponding data. "UNUSED_DATA" Identifies data fields in the input that the template does not reference. Use this function before generation to identify mismatches between the template and the data. The function reads the tags from the template, compares them with the fields in the data, performs the validation specified by analyze, and returns details about the results. This lets you identify template and data issues before you generate the final document. Feedback Was this page helpful? SHARE FEEDBACK Loading...