Pass List Values Into Word Document Template Using SharePoint

This article explains how to pass list values into a Word document template using SharePoint.

Create a team site in SharePoint.

Create a team site in SharePoint

Here we will create one SharePoint custom list and one Document Library.

SharePoint custom list

Now create a Document Library named certificates.

create a document library

Now I will create some columns in the list named "Results".

  • Exam
  • Percentage
  • Result
  • Date

It looks like this:

columns in the list named

So now to create the same fields in the certificate library for mapping.

  • Exam
  • Percentage
  • Result
  • Date

It looks like this.

certificate library for mapping

So now to design a certificate template using Microsoft Word.

The template now looks likes here:

template look

So now to apply this document template to my certificate library.

Open SharePoint designer.

Click on all files.

Click on all files

Open the certificate library.

certificates folder

Open Forms.

Open Forms

Now there is the default template there named “Template.dotx”.

Click Import files from the top of the ribbon.

Import the certificate file from the Windows location.

all file

Now it's imported successfully.

imported successfully

So now I will create a simple workflow for creating a document when the item has been added into the result list.

In the Workflows tab click on List Workflow -> Results.

result

Name the Workflow "Certificate".

Workflow named

Click on Action -> Create list item.

Create list item

Workflow setting

Just click on this list.

A pop-up will be opened. In it select Certificate.

Select Certificate

Map the current item columns with certificate library columns.

Srt the field

lookup for single line

value assignment

Now it looks like this.

look

Click OK and Save.

Click Ok and Save

Now click workflow settings.

click workflow settings

On this page check Start this workflow when an item is created.

check Start this workflow

Click Save and Publish.

Publish

Now it has been published into this list.

Now open "Certificate" repository.

Click on Library settings -> Advanced settings then change the template name to Certificate.docx.

setting

Click Edit Template.

A template has been opened in Microsoft Word now.

Click insert-> Quick Parts -> Document Property.

Quick Parts

Pass the document properties here.

document properties

Now save and close it.

Manually add some date into the results list.

Date into results list

The workflow has been completed now.

workflow

Now the certificate has been generated.

certificate has been generated

So now open the certificates.

certificates

The value has been passed into the document.

You can hide the fields in the Document Library (Certificates).

Happy SharePoint.

Up Next
    Ebook Download
    View all
    Learn
    View all