AiondaAionda

Automate

Documents and templates

Generate documents from record-backed templates and verify the resulting file and attachment.

English · 23 November 2026

Review edition — editorial review is not yet complete.

Templates and generated documents

Feldwerk can fill a Word template with record values and generate a DOCX or PDF as a product operation. This is separate from this handbook’s delivery: the handbook is interactive HTML, with PDF as its only downloadable edition.

A document template is a record in the internal Document templates object. Its DOCX attachment contains the layout and merge tokens. Configuration identifies the source object, output format, filename and any prerequisite formula.

Prepare a template

  1. Create a document template record and give it a descriptive name.
  2. Set the source object to its API name; the example uses chance.
  3. Choose DOCX or PDF output and a filename pattern, such as Summary-{name}.
  4. Upload the DOCX template as an attachment to the template record.
  5. Configure a document-generation action on the source object’s record page.

PDF generation requires the server’s LibreOffice conversion capability to be configured and working. DOCX generation fills the template without that conversion step. A missing converter is a server configuration issue, not a reason to rename a DOCX file to PDF.

One template record, several documents

A template record can contain more than one DOCX attachment. The generator processes each file and returns a ZIP containing the individual outputs. The output format applies to each document; the enclosing download remains a ZIP. Give template attachments distinct filenames so each output is identifiable.

Insert merge tokens

A Content token inserts a field value. For example, <# <Content Select="/chance/name"/> #> inserts the opportunity name. Use actual field API names and supported paths. The field-token widget helps identify available references where configured.

A TableRow token repeats a table row for related child records; Content tokens inside that row use relative paths such as ./feld. Verify the relationship and child order with more than one test child. Supported image tokens require a compatible file value and image type.

Formatting follows the document generator’s rules rather than the viewer’s interface language. The current generator formats values in German conventions. A Format="zahl" Content attribute can suppress a currency or percent symbol where the unit already appears in the column heading.

Repeat a table row for related records

  1. Create a normal table in the Word template. Keep its column headings in a separate header row.
  2. In the row to repeat, insert a TableRow token identifying the child relationship. Use the qualified form child_object.lookup_field when more than one lookup could match.
  3. Place relative Content tokens in the cells of that same row. A path beginning with ./ reads the current child record.
  4. Set an explicit Sort attribute when row order matters, then generate with at least two children to verify it.

Example for a source object handbuch_dokument and child lookup handbuch_zeile.dokument:

<# <TableRow Select="/handbuch_dokument//handbuch_zeile.dokument" Sort="position asc"/> #>
<# <Content Select="./name"/> #>
<# <Content Select="./betrag" Format="zahl"/> #>

The example sorts by the child’s position field, inserts its name and formats its currency amount without repeating the currency symbol. Put “Amount (EUR)” in the header cell if that is the unit used by your data. With no related children, the repeating row disappears; an ordinary header row remains. The relationship loader respects record visibility, so verify the result with the account that will generate the document.

Insert an image from a file field

Store a PNG or JPEG in a File field on the source record. A general Files-panel attachment is not the same as a File field value. Insert an Image token as its own text run; placing it on a separate paragraph helps keep it independent of surrounding text.

<# <Image Select="/handbuch_dokument/logo" Width="4cm"/> #>

Replace the object and field names with your own. Width and Height use centimetres. With Width only, the generator preserves the image’s aspect ratio; with neither dimension it uses a width of 3.5 cm. The current image resolver supports File fields directly on the source record, not a multi-step lookup path or a child-row image field.

A missing or unreadable image is omitted without a placeholder. Check the output before sending it, especially when the image carries essential information. Text tokens can be split across Word runs, but Image tokens must remain in one run. Inspect the actual generated PDF as well as the template.

Require complete source data

A template prerequisite is a boolean formula over the source record’s fields. It must be true before generation is allowed. This is the opposite direction from a validation rule that describes an invalid case.

Provide a useful prerequisite message, such as “Assign an invoice number before generating this document.” A malformed prerequisite also blocks generation. The prerequisite is checked for download, attachment generation and use as a generated email attachment.

Generate and inspect the output

  1. Open a source record with known values.
  2. Select the configured document action, such as Summary.
  3. Wait for the download or an explanatory error message.
  4. Open the file and inspect the record name, values, layout and any repeated rows.
  5. Check the record’s Files panel and the result message to see whether the output was attached.
Opportunity summary document template with English labels for source object, filename, format and prerequisite, plus its template attachment.
  1. Choose the source object, output filename and format.
  2. Configure an optional prerequisite and its message.
  3. Attach the document template file.

Select the screenshot to open the full-size image.

Service planning opportunity with a generated Summary DOCX attached in the Files panel.
  1. Generate the configured document.
  2. Check the resulting attachment and filename.

Select the screenshot to open the full-size image.

The example Summary inserts Service planning and the current next step into a DOCX. Its tokens are resolved and the output is attached to the opportunity. Repeating generation with unchanged data produces the same DOCX content and recognises the identical attachment.

Example: generate and verify a PDF

The checked PDF template uses Opportunities as its source object, PDF as output format and Summary-{name} as filename pattern. The source record is Handbook PDF check, with Amount 1250 and Notes “PDF output inspected locally.”

  1. Set a prerequisite such as wert > 2000 and a useful message. Generation is blocked and no attachment is created.
  2. Change the prerequisite to wert > 1000. Generate again.
  3. Open the PDF and check that the name and notes were inserted and no merge tokens remain.
  4. Confirm that the PDF appears in Files on the source record.
Fictional opportunity with known amount and notes and a generated PDF in its Files panel.
  1. Confirm the source record.
  2. Compare the known source values with the generated document.
  3. Verify the PDF attachment separately from the download.

Select the screenshot to open the full-size image.

The example was converted with the local LibreOffice converter and its PDF text checked. Template values use the generator’s formatting rules, which can differ from the English record display. For a separate check, two DOCX files on the template produced a ZIP with both merged documents.

Download and attachment are distinct results

The standard generation route normally also attaches the document when permitted. A user with read-only access may receive a download without attachment storage. Read the displayed result rather than assuming both operations succeeded. A configured action can explicitly require attachment storage. In the checked read-only case, the member could download the generated document but could not attach it; requesting mandatory attachment storage returned an error. API callers can use ?ablegen=0 for download only or ?ablegen=1 to require storage, and inspect the X-Anhang-Ablage response header.

Identical-output detection concerns actual content. If source values or template content change, a new output may be stored. Do not infer version history solely from filenames, since different files can share a name.

Resolve common document problems

Generate an electronic invoice

The Generate XRechnung (EN16931 / XRechnung 3.0) generator produces an XML file from a record in the rechnung object and its related line items. It does not convert an ordinary PDF invoice into an electronic invoice. Its declared profile describes the generated XML; successful generation alone does not establish that a receiving system will accept it.

An administrator must first provide the objects and field API names expected by the generator. A generic Invoices object with just a name, amount and due date is insufficient. Display labels may be English, but the technical field names below must match the configured data model.

RecordRequired mapping and values
Invoice: rechnungrechnungsnummer (fallback name), rechnungsdatum, faelligkeit and email_primaer must be present. Dates use ISO date values. Customer details come from rechnungsfirma and rechnung_strasse, rechnung_stadt, rechnung_plz, rechnung_land. The net total comes from summe_netto.
Supplier: firmaThe invoice’s rechnungssteller display value is matched against firmenname. Supplier address fields use the same rechnung_* names. Other mapped fields include email, ust_idnr, steuernummer, handelsregisternummer, rechtsform, iban and bic.
Line items: belegpostenThe rechnung lookup links each line to its invoice. Lines are loaded through this relationship, independently of the invoice’s display name. Each line uses leistungsbeschreibung, optional details/leistung_details, einheit, menge, einzelpreis, betrag_netto and mwst. Lines are sorted by description.

Because the current generator resolves the supplier by display text, set the supplier object’s display field to firmenname, use an unambiguous supplier name and inspect the selected supplier. Access permissions and field visibility also affect the data available to the generator.

  1. Complete the invoice, supplier and related line-item records.
  2. Open the invoice and use the configured document-generation action for xrechnung.rechnung. Administrators can add this generator through the record-page action configuration.
  3. Download the XML and check the filename, invoice number, dates, parties, payment information, line items and totals.
  4. Check attachment storage separately. API users can request download only with GET /api/datensaetze/{id}/dokument/xrechnung.rechnung?ablegen=0.
  5. Validate the resulting file against the receiving system’s required profile before using it for delivery. This generator does not submit it to an invoicing network.

For example, the generator checks with net amount 1000 produce tax 190 and payable amount 1190. The output filename follows YYYYMMDD_XRechnung_NUMBER.xml; characters outside letters, digits, underscores and hyphens in the number are replaced with underscores.

Fictional invoice record with two related invoice lines and a generated XML attachment.
  1. Confirm the source record.
  2. Check the related invoice lines used for generation.
  3. Inspect the generated XML filename and attachment.

Select the screenshot to open the full-size image.

The local API example used two related lines with net amounts 800 and 200, and explicitly stored the XML attachment. The record’s general page layout shows its existing fields; administrators can add the generator-specific fields to that layout. Its automatic display number is separate from the invoice number inserted into this example XML.

Current generator limits

If generation reports a missing invoice number, invoice date, due date or primary email, correct the source record and retry. Missing objects or field mappings require administrator configuration. The handbook’s generator tests cover XML structure, field mapping, totals, unit/country fallbacks and missing-field errors; receiving-system acceptance is a separate check.

Prepare an envelope template

A document template supplies the generated file; an envelope template supplies the signature workflow. Under Envelope Templates, create a template and work through Document, Recipients, Options and Button.

  1. Give the envelope a name, select its source object and choose the PDF document generator.
  2. Configure each recipient from a record lookup or a fixed address. Distinguish signers from copy recipients. Check the resolved name and address before sending.
  3. Set the email subject and message. Configure any required source-record field updates for sending, an individual signature or completion.
  4. Save the template and configure its record-page button. Conditions can restrict the button to matching records.
Envelope template recipient configuration with fixed fictional address, Sign action and English role.
  1. Choose the recipient source and whether this person signs.
  2. Check the address and role; signer positions match the document anchors.
  3. Save the template or continue to the next configuration step.

Select the screenshot to open the full-size image.

When you use Set up button in the Button step, the current template changes are saved before the record-page action is configured. Open a source record to check the resulting Send for signature button.

Signer positions correspond to the PDF anchors \s1\, \s2\ and so on. Optional date anchors use \d1\, \d2\. Copy recipients do not occupy a signer position. Verify the generated PDF contains the correct anchors before sending it: an ordinary PDF without signature fields does not provide a place to sign in the public viewer.

The current sending action uses parallel routing. Copy recipients receive the completed documents, without a signing link. Reminder and expiry values on a template are configuration fields; the current sending action does not automatically implement a reminder schedule or copy the expiry interval into the request. Configure and test the intended automation separately.

Review and send a signature request

A record-page Send for signature action can open the signature assistant. Review the generated document and resolved recipients before confirming. The preparation action resolves configuration without sending a request. Sending creates a signature request, stores the original PDF and its hash, creates signer records and queues invitation emails.

  1. Open the source record and select Send for signature.
  2. Inspect the PDF, including its values and signature anchors. Opening this preview or using Download does not attach a file to the source record.
  3. To store the document without sending a signature request, select Done (save as attachment). To continue to signing, select Next: Recipients.
  4. Check each name, email address, role and action. A signer needs the Sign action; a copy recipient does not sign. Add or correct recipients as necessary.
  5. Optionally enter a message, then select Send. Use Back if you need to inspect the document again.
Signature assistant showing a generated PDF with signature and date anchors.
  1. Inspect the generated values and signature anchors.
  2. Save an attachment without sending a request.
  3. Continue to review recipients before sending.

Select the screenshot to open the full-size image.

Signature assistant with a fictional signer, optional message and Send button.
  1. Check each name, address, role and action.
  2. Add a message if needed.
  3. Send queues the invitations; verify delivery separately in Outbox.

Select the screenshot to open the full-size image.

Keep each recipient’s signing link private. It grants access to that recipient’s document without a Feldwerk account. Check the request and Outbox separately: a queued invitation is not proof that the recipient has received it. The handbook demonstration used a local queue and fictional addresses; it sent no external mail.

Sign a document as a recipient

  1. Open your personal signing link and read the document.
  2. Select Start to move to your first signature field, then select Sign here.
  3. Type your name or switch to Draw. Check the displayed signature.
  4. Read and select the consent checkbox. Apply remains unavailable until a signature and consent are present.
  5. Select Apply. If you have more fields, select each remaining field to apply the same signature.
English public signing page for a fictional demonstration with Start and Sign here.
  1. Confirm the request title and use Start to find your field.
  2. Read the document before signing.
  3. Select the highlighted signature field.

Select the screenshot to open the full-size image.

Fictional typed signature and consent checkbox in the English signature dialog.
  1. Type or draw the signature and inspect its preview.
  2. Read and explicitly select the consent checkbox.
  3. Apply the signature or cancel the dialog.

Select the screenshot to open the full-size image.

On a narrow screen, scroll the PDF horizontally inside its viewer to inspect the full page. Start brings your signature field into view.

Completing the final assigned signature field automatically submits the signature after a short delay. You do not need to find an additional final confirmation screen. If submission fails, read the error and use Finish to retry after checking whether the signature was recorded.

Check signature completion and the resulting files

Signed confirmation and signature stamp on the fictional document.
  1. Check the Signed state and confirmation message.
  2. Inspect the visible signature and date; other recipients may still need to sign.

Select the screenshot to open the full-size image.

The Signed state confirms that this recipient’s signature was recorded. It does not mean every other recipient has signed. Reopening the same link shows a confirmation instead of requesting another signature.

After all signers have signed, the request is marked completed. Feldwerk then attempts to create the signed PDF, a separate completion certificate and completion emails. This final processing is best-effort: inspect the request’s Files and Outbox rather than relying solely on its completed status. The checked fictional example produced the original PDF, signed PDF and certificate.

The certificate records signing events and document identification. Treat the generated documents as the output of this configured workflow; this handbook does not establish their suitability for a particular legal form requirement.

Resend or cancel a request

If an invitation has not arrived, inspect Outbox first. Use the request’s configured resend action to issue a replacement invitation. Resending replaces the recipient’s signing token: the previous link stops working. Ask the recipient to use the newest invitation. This does not require creating a second request or generating a different document.

To stop a request, use its configured cancellation action and verify the cancelled status. A cancelled request rejects further signature submissions, even if a recipient still has its old link open. An invalid, expired or cancelled link should be resolved with the sender. The local demonstration checked both replacement-link invalidation and rejection of a signature after cancellation.