Skip to main content

One post tagged with "legal"

View all tags

Demand Letter Template in Power Automate: Generate a PDF Letter for Every Ready Matter in SharePoint with PDF4me

· 32 min read
SEO and Content Writer

PDF4me Generate Document Single is a Power Automate action that merges JSON data into a Word template and returns a finished document. Pointed at a SharePoint list of legal matters, it turns one demand letter template into a PDF letter for every matter marked ready, files each letter in its matter folder, and updates the matter's status.

Search for a demand letter template and page one belongs to court self-help centres, legal aid sites and form libraries. California Courts, WashingtonLawHelp and LawDepot all explain how to write one letter, and explain it well. None of them deals with the firm that sends thirty a week, where the letter is the easy part and the admin around it is not: copying the client, the opposing party and the amount out of the case record, saving the PDF in the right matter folder, and remembering to mark the matter as done. This flow does that admin and leaves the wording where it belongs, in a Word document the attorneys control.

The flow at a glance
1. Manually trigger a flow
Instant flow with no inputs. Run it whenever you want a batch.
2. Get items
Matters list, filtered to Status Ready for Demand Letter and ordered by Title.
3. Select
Maps each matter to the six fields the template uses.
4. Get file content
Reads DemandLetterTemplate.docx once, before the loop starts.
5. Initialize variable
DocIndex, Integer, 0. Counts the letters in this batch.
6. Apply to each
One pass per matter returned by Get items.
7. PDF - Generate Document (Single)
PDF4me PDF. Word template plus the matter as JSON, Output Type PDF.
8. Create file
Saves the letter as the matter ID into its own DemandLetters folder.
9. Update item
Sets Status to Demand Letter Generated so the matter never runs twice.
10. Increment variable
Adds one to DocIndex for every letter filed.
11. Send an email (V2)
One summary to the team with the batch count.