merry678gar
Tera Contributor

Hello,


In a ServiceNow Scoped Application, creating templated PDF output involves generating HTML content that can be passed to the PDFGenerationAPI. While your ideas around server-side templating (e.g., Jelly-based solutions or ECMAScript template strings) are viable, let’s examine practical approaches to achieve this:

1. Jelly-Based Templates
Jelly Limitations: Jelly templates are primarily designed for use in UI Pages and are typically tied to user-interface rendering. While you could theoretically use Jelly to generate server-side HTML, it’s not natively designed for scripting usage outside of its UI context.
Custom Implementations: If you want to use Jelly, you could define Jelly templates as part of the application’s metadata (e.g., stored in Script Includes or as static resources) and invoke them in a controlled manner using Jelly scripting. However, this might involve a lot of overhead, including parsing and managing the output yourself.
Best Regards
merry867