# Using arrays in the pdfmonkey integration

**URL:** <https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371>\
**Category:** Ask for Help\
**Tags:** actions\
**Created:** [April 10, 2023, 7:33pm UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371 "2023-04-10T19:33:22Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![GrumpyRick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/grumpyrick/32/18079_2.png) [@GrumpyRick](https://community.glideapps.com/u/GrumpyRick)\
**Post date:** [April 22, 2023, 1:23am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/21 "2023-04-22T01:23:06Z")

</div>

Ok I have done that like in the Jobs table like this:

08723-22 Jamal Abraham 4.02, 08723-22 Brian Peterson 0.00, 08723-22 Carl Bailey 10.02

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 22, 2023, 1:28am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/22 "2023-04-22T01:28:14Z")

</div>

Then I assume you also have a separate table with unique job rows, or no?

---

<div class="post-metadata">

**Author:** ![GrumpyRick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/grumpyrick/32/18079_2.png) [@GrumpyRick](https://community.glideapps.com/u/GrumpyRick)\
**Post date:** [April 22, 2023, 1:48am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/23 "2023-04-22T01:48:17Z")

</div>

Yes a separate table for Jobs with unique rows. I have connected the filtered timecards to the connected job row and pulled in the html for each job.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 22, 2023, 1:49am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/24 "2023-04-22T01:49:32Z")

</div>

Then can you tell me what is not working?

---

<div class="post-metadata">

**Author:** ![GrumpyRick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/grumpyrick/32/18079_2.png) [@GrumpyRick](https://community.glideapps.com/u/GrumpyRick)\
**Post date:** [April 22, 2023, 2:01am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/25 "2023-04-22T02:01:55Z")

</div>

Not sure in the code here to place the generated HTML.

---

<div class="post-metadata">

**Author:** ![CH310401](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ch310401/32/43293_2.png) [@CH310401](https://community.glideapps.com/u/CH310401)\
**Post date:** [July 2, 2025, 8:57pm UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/26 "2025-07-02T20:57:14Z")

</div>

I have a near identical use case with PDFMonkey. All of this makes sense to me, but it’s unclear to me where I should construct the table portion in Glide? It doesn’t appear that I can do this in a TEMPLATE column, because the TEMPLATE column can’t reference relations.

Where/how do I construct the HTML so that I can pass it to PDFMonkey.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 2, 2025, 10:41pm UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/27 "2025-07-02T22:41:06Z")

</div>

Relations exist as a “pathway” to that row of data, it doesn’t bring you direct data.

To retrieve data, you use the lookup/joined list column and configure further from there.

The ideal way to do this with PDFMonkey is:

- Creating a loop in PDFMonkey to display your table. There’s an actual example of a table here: [Iteration (dealing with lists) | PDFMonkey](https://docs.pdfmonkey.io/references/liquid/loops)

- In Glide, create a JSON object column for each row of data in `lineItems`.

- On the parent level, use a relation and joined list column to get all JSON object backs, separated by a comma and a newline character (for easy viewing).

- Add a template column:

```auto
[
J
]

```

With J being the joined list column above to finish configuring the array structure correctly in Glide.

- Add a PDFMonkey integration, specify your template ID and variables, including the lineItems thing above.

- Glide will pass the lineItems thing as text, you have to add a step to parse it. Let’s say the parsed variable is parsedLineItems.

```auto
{% assign parsed_lineItems = lineItems | parse_json %}

{% for item in parsed_lineItems %}
    <tr>
      <td>{{item.product}}</td>
      <td>{{item.quantity}}</td>
      <td>${{item.price | with_delimiter, precision: 2}}</td>
      <td>${{item.price | times: item.quantity | with_delimiter, precision: 2}}</td>
    </tr>
  {% endfor %}

```

---

<div class="post-metadata">

**Author:** ![CH310401](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ch310401/32/43293_2.png) [@CH310401](https://community.glideapps.com/u/CH310401)\
**Post date:** [July 2, 2025, 10:45pm UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/28 "2025-07-02T22:45:21Z")

</div>

> [@GrumpyRick](#):
>
> ```auto
> <!DOCTYPE html>
> <html>
> <head>
> <title>Job PDF Template</title>
> <style>
> body {
> font-family: Arial, sans-serif;
> font-size: 12px;
> }
> 
> h1 {
> font-size: 24px;
> margin-bottom: 10px;
> }
> 
> table {
> border-collapse: collapse;
> width: 100%;
> margin-bottom: 20px;
> }
> 
> th, td {
> border: 1px solid black;
> padding: 5px;
> text-align: center;
> }
> 
> .total {
> font-weight: bold;
> text-align: left;
> margin-top: 20px;
> }
> </style>
> </head>
> <body>
> <h1>Job Name: {{jobName}}</h1>
> <p><strong>Job Description:</strong> {{jobDescription}}</p>
> <p><strong>Date:</strong> {{jobDate}}</p>
> 
> <table>
> <tr>
> <th>Timecard Date</th>
> <th>Timecard Pay</th>
> </tr>
> 		
> <!-- Loop through the timecard arrays and create a row for each item -->
> {% for item in lineItems %}
> <tr>
> <td>{{item.timecardDate}}</td>
> <td>{{item.timecardPay}}</td>
> </tr>
> {% endfor %}
> </table>
> 
> <p class="total">Total Pay: {{allTotal}}</p>
> </body>
> </html>
> 
> ```

Thank you! That was the missing piece I needed! Thank you so much!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 2, 2025, 10:46pm UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/29 "2025-07-02T22:46:11Z")

</div>

> [@ThinhDinh](#):
>
> Glide will pass the lineItems thing as text, you have to add a step to parse it. Let’s say the parsed variable is parsedLineItems.

Yes, but make sure you do this. Glide has always sent JSON arrays to PDFMonkey as text so we need this extra step.

---

<div class="post-metadata">

**Author:** ![CH310401](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ch310401/32/43293_2.png) [@CH310401](https://community.glideapps.com/u/CH310401)\
**Post date:** [July 3, 2025, 1:12am UTC](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371/30 "2025-07-03T01:12:51Z")

</div>

> [@ThinhDinh](#):
>
> ```auto
> {% assign parsed_lineItems = lineItems | parse_json %}
> 
> {% for item in parsed_lineItems %}
> 
> ```

Success! Thank you! It works perfectly!

[Previous page](https://community.glideapps.com/t/using-arrays-in-the-pdfmonkey-integration/60371.md?page=1)
