Hi. I am trying to create a table and a list using JSON output. The table should have 5 columns (dimension, client score, competitor 1 score, competitor 2 score, insight) and 9 rows below with the content. The list is a set of bullet points comprised of a recommendation and “why” explanation statement. The JSONs are in Airtable and I am using Zapier to initiate document creation in Docupilot. (I have tried the native integration but it is too basic for my needs - it works for many parts of my document, but not the tables and lists.) I have read the documentation and used Gemini, ChatGPT, and Docupilot AI to try to find the right source code for my document to make this work but have not yet done so. Any suggestions?
Hi Rebecca, Here’s how the template should look like according to your description:
Template:
Explanation:
Scores table
- Create a regular table, merge the cells in row2 and row4 and add {{#each scores}} and {{/each}} in those merged cells respectively. These act as start and end markers of the part of the table that should be repeated.
- Add your tokens that are present as part of each score. dimension, client_score, etc.
- This table expands based on number of scores available. If only 1 score is available, just 1 row will be present in the table besides the header row. If 9 scores are available, 9 rows will be present in the generated document.
Recommendations bullet points
- The bullet points work differently with different templates. The example above is for Online Builder templates, where we start and end the loop {{#list fixes}} and {{/list}} in a single bullet point
- For Word/Powerpoint templates, the start and end of the syntax should be added in a blank line above and below as shown in this section of help docs: https://help.docupilot.app/document-template/ms-word-powerpoint-document#bulleted-list
Testing the template
Click on the Test button on top right to see a test form. And this is how the Test form looks like – it expects a list of scores with 5 fields (dimension, client_score, competitor1, competitor2, insight) for each score and a list of fixes with Recommendation and Why_it_matters:
and its’ relevant json payload is structure like this:
{
"scores": [
{
"dimension": "Customer Satisfaction",
"client_score": "4",
"competitor1": "3",
"competitor2": "4",
"insight": "Customer loyalty is increasing"
},
{
"dimension": "Market Share",
"client_score": "3",
"competitor1": "4",
"competitor2": "2",
"insight": "Market share is stable"
}
],
"fixes": [
{
"Recommendation": "Improve onboarding process",
"WhyItMatters": "Enhances customer experience and retention",
"Why_it_matters": "This is the very first impression for customer with your service"
},
{
"Recommendation": "Expand marketing channels",
"WhyItMatters": "Increases brand visibility and leads",
"Why_it_matters": "So that you let more people know what you have to offer"
}
]
}
Generated Document
This is how the Generated document looks like:
Airtable integration
On your Airtable account:
- setup your to Docupilot’s extension as mentioned here
- Select at-least 1 record from your table, map the fields and click on the Generate N Documents as explained in our Airtable integration help docs
- While mapping the fields, you will notice that scores and fixes can be mapped to Linked Records and the child fields like dimension, client_score, Why_it_matters, etc can be picked from the Linked Tables. This gives you freedom to flexibly connect your data sources to your template without any limitations.
Pro Tip: The nested lookup also works when you are not iterating over an array. For examples if you just want to pull client’s address from another table where you manage client’s address, just use
{{client.address}}
in your template and in your Airtable, the extension will ask you to mapclient
to a Linked Record field andaddress
to a field of the Linked Record’s table
- Achieve full automation by generating the Airtable automations code after mapping the fields as explained here. This approach eliminates the need for using Zapier to connect Airtable and Docupilot.