Skip to main content

TrueSign Gen — Document generation

TrueSign Gen — from template to filled document (1 min)Real demo — Salesforce org + Yousign sandbox · Watch on YouTube

TrueSign Gen builds the document before getting it signed: a template containing tags is merged with Salesforce data, converted to PDF, then — optionally — sent for signature. All in one click.

Two ways to supply the template, your choice in the Content tab:

  • Inline editor (text → PDF) — you write the document straight inside TrueSign and insert tags with the Tag Builder. No Word file needed.
  • Word / file upload — you upload a .docx prepared on your side, useful when the layout is complex or imposed.
Check before you send

The Preview with data button renders the document against a real record from your org, using the very same engine as the final generation — and saves nothing.

A sales rep opens the opportunity and clicks "Generate and sign the quote": product lines, prices and address are resolved from the Word model, the PDF is produced and the send goes out — a single action.

Merging happens inside your org

No record data leaves Salesforce to be merged: the engine runs in your org, and so does the PDF conversion. This is the most important architectural difference with DocuSign Gen, which ships the XML of your data to its servers. Direct consequences: nothing to declare as a transfer, no provider outage can stop generation, and no throughput cap (DocuSign limits you to 100 generations per 10 minutes).

1. Tag reference

Every tag is written between double braces, directly in the Word document.

Values

TagEffect
{{Field}}A field of the source record
{{Object.Field}}A field of a related record — {{Account.Name}}
{{A.B.C.Field}}Relationship traversal, up to 5 levels
{{alias.Field}}A field of a related list, through its alias (§3)

A tag that does not resolve is removed from the document — it never leaves {{Field}} in plain sight inside a contract. A field the user is not allowed to read renders empty, without failing the generation.

Conditions

{{if Amount > 10000}}
This order follows the key-account procedure.
{{else}}
Standard processing.
{{endif}}
ElementDetail
Operators== != > < >= <= contains
Combinationsand / or — quoted text is never split ('Research and Development' stays whole)
{{else}}Supported — no need to write two mirror conditions
CaseInsensitive by default
NestingUp to 10 levels

Loops

{{for each lines}}
{{lines.Product}} — {{lines.Quantity}} × {{lines.UnitPrice | currency}}
{{end each}}

Loops nest, and conditions inside them are evaluated row by row: {{if lines.Price > 15}} only shows on the rows concerned.

Repeated table rows

This is the number-one use case for a quote or a product schedule:

  • put {{for each lines}} in the first cell of the table row;
  • put {{end each}} in the last cell of the same row;
  • TrueSign clones the whole row, one per record.

If both tags sit in a single cell, the behaviour stays the classic inline loop — your existing models render exactly as before.

Empty list? The row disappears. If it was the table's only row, the whole table is removed (a table with no row makes the file unreadable by Word).

Formatting

TagResult
{{Date | date:"dd/MM/yyyy"}}Date in the chosen format
{{Amount | currency}}24 500,00 € — separators per the model's locale
{{Amount | currency:"$"}}Forced symbol
{{Number | number}} / {{Number | number:2}}Grouped number, no symbol, chosen decimals

Images

{{image Logo__c}} {{image Logo__c:6x2}}

The field holds the identifier of a Salesforce file. The image is inserted into the document (dimensions in inches, optional). Word models only. A file the user is not allowed to read is not inserted.

Salesforce formulas

{{formula: IF(Amount > 50000, "Key-account discount", "Standard rate")}}
{{formula: TEXT(YEAR(CloseDate)) & "-" & Account.Name}}

The native Salesforce formula engine evaluates the expression: functions, calculations, conditions, dates, text. Referenced fields are added to the query automatically — no extra cost.

What DocuSign cannot do

Both DocuSign generation products explicitly exclude formulas and inline calculations in the document; their official workaround is "create a formula field in Salesforce and hide it from the layout". Here, the formula lives in the model.

2. Create a Gen model

TrueSign → Gen Templates → New:

  1. Source object — the Salesforce object generations will start from.
  2. Word document — the .docx with its tags.
  3. Related lists (§3) — the aliases used by loops.
  4. Options:
OptionEffect
File nameAccepts merge tagsQuote {{Account.Name}} {{CloseDate}}
SuffixAppended to the name (date, source object name)
Currency localeAmount formatting for this model
DestinationRecord files, library, or both
Linked envelope templateTo chain generation → signature
Automatic launchGeneration fires on click, no intermediate screen
Preview before sendThe user checks the resolved PDF before confirming
Send for signatureCan be disabled — Gen then only produces the document
ActiveA real circuit breaker: an inactive model does not generate, even when called by a Flow

The preview replays the real pipeline, including the related lists you have just configured without saving them: what you see is what the document will be.

The object must match

Generating from a record of a different object than the source object is explicitly refused, with a message — rather than producing an entirely blank document in silence.

A related list carries an alias (used by {{for each alias}}) and three settings that keep it under control:

SettingExampleDetail
FilterTitle = 'CEO' AND IsActive = trueOperators = != < <= > >= LIKE IN NOT IN, combinable with AND / OR
SortLastName ASC NULLS LASTSortable fields only
Cap200From 1 to 2000 — 2000 by default

null values and Salesforce date literals (TODAY, LAST_N_DAYS:30…) are accepted in filters.

This is not raw SOQL

You write a mini-language that TrueSign parses and rebuilds: every field name is re-validated, every value is typed then bound to the query. An injection attempt is refused. That is the difference with DocuSign, which has you type SOQL directly.

An invalid clause fails the generation with a message — never a silently unfiltered schedule.

The cap is not a nicety: a 50,000-row list with no limit exhausts the transaction's resources.

4. Output and automation

  • Word, PDF, CSV or HTML. PDF conversion happens in the org by default. An external conversion engine can be configured; it is then only accepted over https.
  • Button on the record page — see Custom buttons.
  • Flow action: generation is exposed as an invocable action, usable from any Flow or Next Best Action strategy.
  • Generate + send in a single action, through the linked envelope template.
CSV or HTML output: generated files are safe to open

A merged value comes from a record — therefore potentially from a third party (portal entry, web form, import). TrueSign accounts for this:

  • CSV — values that would start with =, +, -, @ are neutralized (leading apostrophe, OWASP recommendation) so none is executed as a formula by Excel or Google Sheets. Legitimate negative amounts (-42) stay intact.
  • HTML — every merged value is escaped: it can never inject markup. The model body itself stays free — your admin writes it.

See Security architecture.

5. Good practice and known limits

  • Word sometimes splits a tag into several invisible pieces (spell-checker, partial formatting). TrueSign re-glues them automatically — a classic problem left untreated elsewhere. If a tag still resists, retype it in one go with no intermediate formatting.
  • {{formula:}} and {{image}} tags also work inside a repeated table row, as do source-record fields.
  • The & character: an & in a merged value ("Black & Decker") can produce an unreadable Word document. A fix is in progress on the product side; meanwhile, avoid that character in data bound for a Word model, or strip it with a formula.

6. Access

Generation requires the TES_GenUser permission set (or TES_Admin). The "Document Generation" Setup entry shows a lock for unauthorized users.

7. AI assistance (optional)

TrueSign Gen can offer writing assistance for your models. It is disabled as long as no key is entered, and can be switched off at any time from the configuration.

What to know before enabling it:

  • the assistance sends the model and record context to an external AI service — it is the only case where data leaves your org anywhere in the Gen journey;
  • the access key is stored like the other secrets, unreadable outside the package;
  • the usage must appear in your processing register if the context transmitted contains personal data.

See GDPR & data residency.