DEV Community

Cover image for From Template to Tailored:The Power Platform Way
Bala Madhusoodhanan
Bala Madhusoodhanan

Posted on

1 1 1 1 1

From Template to Tailored:The Power Platform Way

Intro:
In today’s fast-paced business environment, efficiency and automation are key to staying ahead. Imagine a scenario where various teams within your organization need to generate Non-Disclosure Agreements (NDAs) quickly and accurately. Manually creating these documents can be time-consuming and prone to errors. By using Microsoft Forms as a trigger, we’ll collect the necessary information from users, pick a Word template from OneDrive, and populate it with the provided data. Finally, we’ll automate the process of emailing the completed NDA to the requester

Conceptual Architecture:

The below diagram illustrates the process from the user submitting the form to the final step of emailing the populated NDA

Image description

Logics in actions:

Some Business Logic to populate the word template were as below

1) Few Date Manipulation - all the dates are dummy values but were pulled / mapped from the Microsoft FORM template

To get the year of contract created

Year(DateValue("2024-09-11"))
Enter fullscreen mode Exit fullscreen mode

To get the month of the contract created

Text(DateValue("2024-09-11"), "mmmm")
Enter fullscreen mode Exit fullscreen mode

To calculate the no of terms of contract

RoundUp(DateDiff(DateValue("2019-06-01"), DateValue("2024-01-01"), TimeUnit.Years), 0)
Enter fullscreen mode Exit fullscreen mode

To populate dates for periodic review
adds a specified number of units to a date value. In this case, you’re adding 425 days to the date “2024-01-01”.

DateAdd(DateValue("2024-01-01"), 425, TimeUnit.Days)
Enter fullscreen mode Exit fullscreen mode

2) Had to create a custom connector to convert numbers into string / text as legal documentation you specify the value of the contract in text.

DEMO:
The demo is just a proof of concept as the solution was specific to the problem solving / opportunity I was exploring

Unit test to mimic the data from MS form

data Input

The email attached with the updated working document

email

The “Populate a Microsoft Word template” action in Power Automate can be incredibly versatile and useful in various business scenarios like

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay