How can I populate certain fields in a Word Form Template from an SQL Server Database?

Jeremy Woolley 21 Reputation points
2021-12-15T18:03:01.427+00:00

Here at my work we have a Safety Database where we collect incident information. We also have a word Template in our policy and procedures that allows managers to fill out the form to report and comment on certain incidents of note. If the form is being filled out for a specific incident, the manger would like to put the incident number in the Word Form and have it populate 2 or 3 of the forms fields and still allow the manager to make changes to those fields and then continue to fill out the rest of the form.

I am unsure how to do this. Does anyone have any help they can send my way? The form is also a locked form template, it resides on SharePoint, and we are in the process of moving from Word 2016 to Office 365...just FYI.

Thank you.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,714 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,625 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
893 questions
Microsoft 365 Publishing
Microsoft 365 Publishing
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line. Publishing: The process of preparing, producing, and releasing content for distribution or sale.
595 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ronen Ariely 15,096 Reputation points
    2021-12-15T23:18:23.477+00:00

    Good day ,

    You can use Power Automate or Logic Apps for the task. In the following link you have a full example of filling word template:

    https://tahoeninjas.blog/2020/03/13/generate-word-documents-from-a-template-using-power-automate/

    Basic architecture can be:

    (1) create word template and store it online in OneDrive for Business, SharePoint Online Sites, or Office 365 Groups.
    (2) when the form is send then trigger the logic apps and pass the information from the form. Note that if you are using Microsoft forms then then this can be done directly with logic apps using the דubmitting םכ the form as the trigger that executes the app.
    (3) In the logic apps (or Power Automat) you can fill the template and create and store as new file or send it by email

    If you need option to re-edit the document then you can store the information in SQL Server before you create the file and when you need to edit it then you can read the data from the database -. add the missing information -> and do the same to create a new file or send it

    Recommend to read this documentation about the Word online:
    https://learn.microsoft.com/en-us/connectors/wordonlinebusiness/


2 additional answers

Sort by: Most helpful
  1. Charles Kenyon 2,561 Reputation points
    2021-12-16T20:16:16.96+00:00

    The typical way to put data into a form from a database is mail merge.

    https://support.microsoft.com/en-us/office/mail-merge-using-an-excel-spreadsheet-858c7d7f-5cc0-4ba1-9a7b-0a948fa3d7d3?ui=en-us&rs=en-us&ad=us
    http://www.addbalance.com/usersguide/mailmerge.htm
    Ordinarily mail merge does not work with protected forms. However, this Add-In allows use with protected forms:
    http://www.gmayor.com/ManyToOne.htm

    0 comments No comments