For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate PDFs from Flow

LFS version: requires Limio for Salesforce v14.27 or later

Two invocable actions let a flow render a Salesforce email template as a PDF and attach it to a record. Both appear in Flow Builder under the Limio For Salesforce category. Use them in this order: generate the document, then store it.

Generate PDF from Email Template

Renders an email template against a record and returns a base64 encoded PDF.

Input
Required
Purpose

Email template

Yes

Template Id or DeveloperName. Classic, Lightning and Visualforce templates all work.

Record Id

No

The record that supplies the object merge fields, such as the Limio Quote or the Opportunity.

Data JSON

No

JSON that supplies the template tokens, for example the value of a JSON field on the record.

Output
Purpose

Success

Whether the render succeeded.

Error message

The reason for a failure.

File name

The generated file name.

Document content (base64)

The PDF itself. Pass this to Store PDF Against Record.

Store PDF Against Record

Stores a base64 encoded PDF as a Salesforce file, linked to a record.

Input
Required
Purpose

Document content (base64)

Yes

The output of Generate PDF from Email Template.

File name

Yes

The file name to store, including the .pdf extension.

Link to record Id

Yes

The record that the file is linked to and visible from.

Add as new version

No

When true, a file with the same name on the record gains a new version. When false, a second file is created. The default is false.

Output
Purpose

Success

Whether the file was stored.

Error message

The reason for a failure.

The action removes special characters from the file name and keeps it to 80 characters. For example, Quote #12345 — Acme.pdf is stored as Quote 12345 Acme.pdf.

Template tokens in Data JSON

In the template body, data is the reserved root of the JSON you supply.

Token
What it does

{{data[0].offer.name}}

Reads one value.

{{data.total ?? 'n/a'}}

Falls back from left to right when a value is missing.

{{#each data}}...{{/each}}

Repeats the markup between the tags. {{this}} is the current item.

{{table data | description:Item, quantity:Qty}}

Renders a table. One nested level is allowed after a semicolon.

Wrap a column label in single quotes when it contains a comma, a semicolon or a colon.

Limits

Limit
Value

Size of one document

1.5 MB

Documents in one transaction

25

Total PDF size in one transaction

About 1.7 MB

Rows in one {{table}} token

500

Rows in all {{table}} tokens of a document

2000

Repeats in one {{#each}} loop

500

Repeats in all {{#each}} loops of a document

5000

When an action reaches a size or count limit, it returns Success = false and a message in Error message. The flow continues.

When a template reaches a row limit, the action returns Success = true with fewer rows. A {{table}} token adds the row "N further rows were omitted because the row limit was reached." A {{#each}} loop shows no message. Check the PDF before you send it to a customer.

Repeat runs

When the flow can run more than once for the same record, set Add as new version to true. Each run then adds a version to the same file, and the earlier versions stay in the version history. With the default of false, each run stores a separate file.

Permissions

The Assisted Sales - Admin and Assisted Sales - User permission sets give access to these actions. If your org uses a cloned permission set, add access to the Apex classes GeneratePdfFromEmailTemplate, PdfGeneratorService and StorePdfDocument. See Permission Sets.

The Limio Quote record page has a Related Documents tab from v14.27. Stored files appear there.

Last updated

Was this helpful?