Skip to content

Word Append Table

Type: word-append-table  ·  Package: Word Activities v1.0.4

Appends a DataTable as a table in the document, with single borders and, optionally, a bold header row. It is how you include tabular data in a generated report: a sales detail, a results table.

Inserts table as a Word table at the end of the document. By default it writes the column names as a bold first row (hasHeader = true). It only works inside a session; the change stays in memory until the document is saved.

  • Each cell is written as text (the value converted to text; nulls stay empty). If you need a specific format (dates, currency), prepare the column first with DataTable.
  • All cells get a single border; Word adjusts the column widths when it opens the document.
  • A DataTable with no rows adds only the header row (if hasHeader = true).
  • hasHeader is set in the editor; it does not accept expressions.
ParameterTypeDefaultDescription
tableDataTable—The DataTable to insert.
ParameterTypeDefaultDescription
sessionZoanWordSession—Word session. Inherited automatically inside a body.
hasHeaderbooltrueWrite the column names as a bold header row.

This activity does not return a value.

DB Query sql = "SELECT Product, Quantity, Total FROM Sales WHERE Month = @month" params = { "month": month } → output: sales
Word Create path = "C:/reports/sales.docx"
└─ body:
Word Append Paragraph text = "Sales Detail" style = Heading1
Word Append Table table = sales
MessageCause and fix
'table' must be a DataTable.The table value is not a DataTable (for example, a list or a text). Convert the data to a DataTable first.
'session' must be a valid Word session (use word-open or word-create).The activity is outside a Word Create/Open body and got no session.