Free plan
Fill a Template
Fill the gaps of an Excel, Word or PowerPoint template
About this tool
A template is a file with gaps written like {{name}}. This tool replaces each gap with a value you give it. It works in Excel, Word and PowerPoint files. You decide what happens to a gap that has no value: keep it, leave it blank or stop with an error. Files that contain macros are refused.
For example, you have an offer letter template and fill in the customer name and the price.
How to use it
- Choose this tool.
- Add your template file with gaps like {{name}}.
- Type the values to put in, as a list of names and values.
- Choose what to do with gaps that have no value.
- Press Generate.
What you get back
You get a new filled-in file to download, and any gaps that stayed empty are listed.
GOOD TO KNOW
A template in, the filled file out (same type). In Excel a cell that holds only a placeholder whose value is a number becomes a real number cell. Counts as one document.
TEST IT LIVE
Try Fill a Template in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/template
Tool ID
documents.template
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/documents/template" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'data={"name":"Ada","total":12.5}' \
-F 'missing=keep' \
-F 'response=url'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.template({
"file": 'document.pdf',
"data": "{\"name\":\"Ada\",\"total\":12.5}",
"missing": "keep",
"response": "url"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->template([
'file' => 'document.pdf',
'data' => '{"name":"Ada","total":12.5}',
'missing' => 'keep',
'response' => 'url',
]);
echo $result->requestId;More in Documents
