Microsoft Project Online solution enables the storage of project data in a central repository to increase visibility across the organisation. Reporting on that data can be generated using different tools available such as SSRS, Power BI etc. An example of the reporting output is a nicely formatted Word document with the most up-to-date project status data, for distribution around the organisation i.e. a Project Status Report.
The benefits in generating Word documents for such reports include ease of formatting, PDF conversion, the sharing/printing the document.
In this blog post, I will walk you through the steps of automatically generating a Word document in MS Project Online using a Word doc template. I will also cover the use of MS Flow with the help of the latest Word Online connector (please note that connector is still in preview mode).
The scenario I depict in this post is after entering project data for the project. I will then set a certain flag on a project indicating the data is ready to be populated and the project is ready to be published. Flow is triggered by Project Publish event, which checks the flag value and if it appears as ‘true’ it will then generate a dedicated Word document based upon the template and populate it with the project data.
Let’s look at the first step, the Project Online set-up process:
|1.||Below is a project I created in Project Online with some basic custom fields on a project detail page.|
|2.||Note that I have deliberately included a flag field of Generate Document.|
|3.||I then updated the fields with some data and saved my project.|
Then, let’s prepare a Word document template to be automatically populated at a later stage:
|1.||In order to prepare a Word doc template, you need to enable the Developer tab. The Developer tab is not displayed by default, but you can add it to the ribbon, the tab can also do several things including inserting controls.|
|2.||To add the Developer tab on your Word application, follow this link: Show the Developer tab|
|3.||Once you enabled the tab, it will appear as below and you can add text content Controls into your document.|
|4.||Go to Design Mode under Controls and enable plain text control on a page, and then use Properties to assign a friendly name to that control.|
|5.||I have prepared a simple Word doc template after adding a few text controls and an image.|
|6.||After preparing the template, I saved it to my PWA Shared Documents library.|
Now the last part of this exercise is to bring all of this together with the help of none other than, the actual hero of this post, MS Flow.
Now to trigger this flow, I have to publish the project. Once published and the Flow has run successfully, we can see an output Word document file generated and saved automatically in my chosen document library.
And if I open a file, either in word online or download and then open in word, it comes up as a nicely formatted document generated automatically from my project data.
Hope this will help, enjoy.