Let’s start by creating a simple workflow that asks a user for their name and age, then uses this information to generate a Word document.
First, create a new workflow on your AutoDocument Home Screen and name it “Tutorial 1”.
Your form collects the information AutoDocument will use. Click “Add Form Field” to add your first input:
name
(This is the unique keyword AutoDocument uses for substitution.)Client's Name
(This is what the user sees on the form.)String
(Since a name is text.)age
Client's Age
Number
Next, let’s define what AutoDocument will produce.
If you have Microsoft Word, create a new .docx
file with the following content:
Hi {{name}}, your age is {{age}}.
(The double curly braces {{ }}
tell AutoDocument to replace these with values from your form fields.)
Now, back in AutoDocument, navigate to the “Outcomes” section and click “Add Microsoft Word”:
Template
.
(This means you’ll upload your Word document when you run the workflow.){{name}}.docx
.
(Yes, AutoDocument can use your field values to name the output file!)Click “Submit”. Your workflow is now ready!
AutoDocument will display the live progress. Once complete, a “Download” button will appear. Click it to download a .zip
file. Inside, you’ll find a file named Bob.docx
. Open it to confirm that “Bob” and “25” have replaced the placeholders in the document!
AutoDocument excels at generating multiple documents from a single source of data, like a .csv
file. In this tutorial, we’ll create a workflow that uses a CSV to produce a separate Word document for each record.
Start by creating a new workflow and naming it “Tutorial 2”.
Click “Add a CSV Table”. This type of source can either “Split” your workflow into separate runs for each record, or load all records into a single field.
Client Records
.
(You’ll upload your CSV file when you run the workflow.)Create a .csv
file, for example ClientRecords.csv
, with the following content:
name,age
John Doe,48
Jane Doe,35
Alice Bob,28
Now, let’s define the output document, similar to Tutorial 1. Click “Add Microsoft Word” in the Outcomes section:
Template
.
(You can reuse the same Word document template from Tutorial 1, Hi {{name}}, your age is {{age}}.
){{name}}.docx
.When you run this workflow, you’ll upload your ClientRecords.csv
file and your Word template. The downloaded .zip
file will contain three Word documents—one for “John Doe”, one for “Jane Doe”, and one for “Alice Bob”—each personalized with the details from your CSV!
You can build powerful, complex workflows by combining multiple data sources. This tutorial illustrates an advanced example, assuming some initial setup of databases and file storage.
Imagine you manage clients in categories (A, B, C) and need to generate invoices for each client within a chosen category. Each invoice needs to list all ordered items, and then be saved to a client-specific folder on a shared network drive.
category
Client Category
String
SELECT client_id, client_name FROM Client WHERE category = :category
(The :category
placeholder tells AutoDocument to use the value from the previous “category” form field.)
category
, client_id
, and client_name
available.SELECT item_name, quantity FROM ItemOrder WHERE client_id = :client_id
(Each workflow split from the previous step will have a unique client_id
for this query.)
items
.
(This will gather all items for the current client into a list named items
, rather than splitting the workflow further.)client_id
from Step 1).You can now design your Word template to loop through the items
list:
Hi '{{ client_name }}',
Here is your invoice for your purchase of items:
{% for item in items %}
{{ item['quantity'] }} units of {{ item['item_name'] }}.
{% endfor %}
Finally, configure your “Microsoft Word” outcome:
Templates\InvoiceTemplate.docx
.
(This assumes your template is stored in your configured Windows File Storage.)Invoices\{{client_id}}\Invoice.docx
.
(This will create a path like \Invoices\123456\Invoice.docx
for client ID 123456.)You now have a robust workflow that can generate all invoices for a specific client category, dynamically pulling data from your database and saving them in organized folders on your network drive!