Save HTML Snippet Page as PDF with Dynamic Data in Zoho Creator (Working Solution)

Save HTML Snippet Page as PDF with Dynamic Data in Zoho Creator (Working Solution)

Hi Zoho Creator Community đź‘‹,

I faced a common challenge while working with HTML Snippet Pages — I needed to generate a PDF with dynamic data and save it back into the record automatically.

Here’s the working solution that might help others.


Use Case

  • Generate a PDF from an HTML Snippet Page

  • Pass dynamic values (like Investor Name, Amount, etc.)

  • Save the generated PDF into a File Upload field

  • Use the same PDF for email automation


Key Requirement

The HTML Snippet Page must be published and should use page variables.

Example page variable:

InvestorName

URL Format

https://creatorapp.zohopublic.in/export/<owner_name>/<app_link_name>/pdf/<page_link_name>/<public_key>/?isc5page=true&<param>=<value>

Working Deluge Code

url = "https://creatorapp.zohopublic.in/export/kpfs.one/test-copy-of-ssio-iv/pdf/DD_Notice/A9839SPwpGaGPbrzdfjhdfhdjadvhdf7vC5ZNFpkfPsSDvreh4rjtHhNFzGUqaUZarByUtFuXvMf0vrDWq1Z7ZGbty/?isc5page=true&InvestorName=" + input.Investor_Name;

response = invokeurl
[
url : url
type : GET
];

response.setFileName("CRMAccounts.pdf");
input.DD_Notice_File = response;

What This Solves

  • Renders the HTML Snippet Page as a PDF with dynamic data

  • Saves it directly into the record

  • No manual download/upload required


Hope this helps anyone struggling with dynamic PDF generation in Zoho Creator! 🙌

Code Explanation (Step by Step)

1. Build the Export URL

url = "https://creatorapp.zohopublic.in/export/kpfs.one/test-copy-of-ssio-iv/pdf/DD_Notice/A9839SPwpGaGPbrzdfjhdfhdjadvhdf7vC5ZNFpkfPsSDvreh4rjtHhNFzGUqaUZarByUtFuXvMf0vrDWq1Z7ZGbty/?isc5page=true&InvestorName=" + input.Investor_Name;
  • This URL points to the published HTML Snippet Page.

  • export/.../pdf/... tells Zoho Creator to render the page as a PDF.

  • isc5page=true ensures it is treated as a Creator Page (HTML Snippet Page).

  • InvestorName is a page variable used inside the HTML snippet (${InvestorName}), and we pass its value dynamically from the form using input.Investor_Name.


2. Call the Page Using invokeurl

response = invokeurl
[
url : url
type : GET
];
  • invokeurl makes an HTTP request to the page URL.

  • Zoho renders the HTML page with the dynamic data and returns the generated PDF file as the response.


3. Rename the Generated File

response.setFileName("CRMAccounts.pdf");
  • Sets a user-friendly file name for the PDF before saving it.


4. Save the PDF into the Record

input.DD_Notice_File = response;
  • Stores the generated PDF into the File Upload field of the form.

  • Now the document is permanently attached to the record and can be emailed or downloaded later.


This approach allows you to fully automate PDF generation from an HTML Snippet Page with dynamic data in Zoho Creator.

— Mahesh Waje (KPFS)