Populating Likert Scale Results into a PDF from an HTML Template

I'm working on a project where I need to generate a PDF document from an HTML template, specifically to display the results of a Likert scale. The data for the Likert scale is provided in a JSON payload, but I'm encountering issues with correctly populating this data into the PDF. I can populate the list in its entirety but would like to populate each item in it's appropriate cell.

Here's a brief overview of what I'm dealing with:

JSON Payload:

"EmergencyDutiesLikert": [
  "Above Standards",
  "Meets Standards",
  "Meets Standards",
  ...
]

HTML Template:

<div class="header">Emergency Duties Feedback</div>
<p>{{EmergencyDutiesFeedback}}</p>
<p>{{EmergencyDutiesLikert}}</p>
<p>{{EmergencyDutiesLikert[0]}}</p>
<table>
    <!-- Emergency Duties Criteria -->
    <tr><td>Response Towards Training and Emergency Activities</td><td>{{EmergencyDutiesLikert.[0]}}</td></tr>
    <tr><td>Ability to Learn, Retain, and Apply Information</td><td>{{EmergencyDutiesLikert.[1]}}</td></tr>
    <tr><td>Effort to Improve</td><td>{{EmergencyDutiesLikert.[2]}}</td></tr>
    <!-- ... -->
</table>

The issue is that the resulting PDF does not display the Likert scale evaluations as expected. Here's an example of the output I'm getting (screenshot attached):

image

Does anyone have insights on what might be going wrong or what I'm missing in this process? Any help or suggestions would be greatly appreciated!

Thank you in advance!

Hi @JohnBalagtas,

I reproduced the issue and I'm going to discuss with my team if we can address the array elements this way {{EmergencyDutiesLikert[0]}} or {{EmergencyDutiesLikert.[0]}}. I'll keep you posted about the results.

Best regards,
Petr
Plumsail team

Thank you, Petr. I also recommend changing the current JSON payload for Likerts so that each item in the array includes both the question and the response.

Current JSON Payload Structure:

"EmergencyDutiesLikert": [
  "Above Standards",
  "Meets Standards",
  ...
]

Proposed JSON Payload Structure:

"EmergencyDutiesLikert": [
  {
    "Question": "Response Towards Training and Emergency Activities",
    "Response": "Above Standards"
  },
  {
    "Question": "Ability to Learn, Retain, and Apply Information",
    "Response": "Meets Standards"
  },
  ...
]

How to Call it in the HTML Template:
With the proposed JSON structure, the HTML template can be simplified to iterate through each object in the Likert arrays, displaying both the question and the response. Here's an example of how it can be implemented:

<table>
    <tr><th>Criterion</th><th>Evaluation</th></tr>
    {{#each EmergencyDutiesLikert}}
    <tr>
        <td>{{this.Question}}</td>
        <td>{{this.Response}}</td>
    </tr>
    {{/each}}
</table>

Hello @JohnBalagtas,

Yes, currently, you can address arrays elements as you described.

{{EmergencyDutiesLikert.Question}} or {{this.Question}};

Using {{EmergencyDutiesLikert.[0]}} is not supported.

Best regards,
Petr
Plumsail team