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.
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
The HTML Snippet Page must be published and should use page variables.
Example page variable:
InvestorName
https://creatorapp.zohopublic.in/export/<owner_name>/<app_link_name>/pdf/<page_link_name>/<public_key>/?isc5page=true&<param>=<value>
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;
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! ๐
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.
invokeurlresponse = 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.
response.setFileName("CRMAccounts.pdf");
Sets a user-friendly file name for the PDF before saving it.
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)