When i try using templating in generate asset block, to generate a pdf from a json variable, the pdf shows the json path of variables ad not the values.
Help me debug this, i have tries using get also the doesn’t work either.
When i try using templating in generate asset block, to generate a pdf from a json variable, the pdf shows the json path of variables ad not the values.
Help me debug this, i have tries using get also the doesn’t work either.
Hi @amandayal,
The most likely cause is incorrect variable references in the Generate Asset block. Here are a couple of resources that might help:
If you can share some screenshots or a Loom of your setup, especially the Generate Asset block code, its configuration, and a sample run in the Debugger, that would help us better understand what’s going on.
here is the asset block html,
Payment Analysis Report body { font-family: Arial, sans-serif; margin: 40px; } h1, h2 { color: #2c3e50; } table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } th, td { padding: 8px 12px; border: 1px solid #ccc; text-align: left; } th { background-color: #f4f4f4; } .section { margin-bottom: 30px; }Date: May 26, 2025
<div class="section">
<h2>1. Total Contract Value</h2>
<p>${{ paymentAnalysisResults.totalContractValue }}</p>
</div>
<div class="section">
<h2>2. Payment Schedule</h2>
<table>
<tr>
<th>Milestone</th>
<th>Percentage</th>
<th>Amount</th>
</tr>
{{#each paymentAnalysisResults.paymentSchedule %}}
<tr>
<td>{{ this.milestone }}</td>
<td>{{ this.percentage }}%</td>
<td>${{ this.amount }}</td>
</tr>
{{/each}}}
</table>
</div>
<div class="section">
<h2>3. Compliance Analysis</h2>
<h3>Initial Deposit</h3>
<ul>
<li>Percentage: {{ paymentAnalysisResults.initialDeposit.percentage }}%</li>
<li>Amount: ${{paymentAnalysisResults.initialDeposit.amount }}</li>
<li>Guideline Limit: {{ paymentAnalysisResults.initialDeposit.guidelineLimit }}%</li>
<li>Status: {{ paymentAnalysisResults.initialDeposit.complianceStatus }}</li>
</ul>
<h3>Final Payment</h3>
<ul>
<li>Percentage: {{ paymentAnalysisResults.finalPayment.percentage }}%</li>
<li>Amount: ${{ paymentAnalysisResults.finalPayment.amount }}</li>
<li>Guideline Minimum: {{ paymentAnalysisResults.finalPayment.guidelineMinimum }}%</li>
<li>Status: {{ paymentAnalysisResults.finalPayment.complianceStatus }}</li>
</ul>
</div>
<div class="section">
<h2>4. Deviations from Guidelines</h2>
<table>
<tr>
<th>Item</th>
<th>Deviation</th>
<th>Impact</th>
</tr>
{{#each paymentAnalysisResults.deviationsFromGuidelines }}
<tr>
<td>{{ this.item }}</td>
<td>{{ this.deviation }}</td>
<td>{{ this.impact }}</td>
</tr>
{{/each}}}
</table>
</div>
<div class="section">
<h2>5. Recommendations</h2>
<table>
<tr>
<th>Recommendation</th>
<th>Rationale</th>
</tr>
{{#each paymentAnalysisResults.recommendations }}
<tr>
<td>{{ this.recommendation }}</td>
<td>{{ this.rationale }}</td>
</tr>
{{/each}}}
</table>
</div>
If you have invalid Handlebars syntax in your template, the entire template will fail to compile. So somewhere in your template something is breaking, which is causing the entire thing to break. Try removing sections until you get it to compile successfully, and then re-add sections until you find what is broken. As a start, I’m not sure what the {{#each paymentAnalysisResults.paymentSchedule %}}
% symbol is doing here—you might want to try removing that as it doesn’t look like valid Handlebars syntax to me.
thanks for pointing it out, but the entire thing will fail due to one issue?
Correct. The Generate Asset block uses Handlebars, which is a templating language. If the template fails to compile due to a syntax error (e.g., if you try to use a helper function that doesn’t exist or have something that is improperly formatted), it will break completely and will not render anything. If there is an error in the data at runtime (e.g., a variable can’t be found, or its value is weird, or something like that), however, it will still compile just with weird/broken data.