Part 01 (This Article)
Yes ! a simple and yet solid Microsoft Flow can be configured to fill-out a Word Document stored in your SharePoint library in conjunction with Quick Parts.
Image Courtesy: brookfieldinstitute
With this blog series, I’m going to demonstrate, how you can utilize legacy and yet famous Office Quick Parts with Microsoft Flow to optimize your content creation!. Well, Quick Parts aren’t new, they have been in Office suite since 2010 but still being famous among content creators due to its usability.
To get started, you need the following fundamentals:
- Office 365 subscription with SharePoint, MS Flow Capabilities
- A document library to store documents
- Microsoft Office Application Installed in your PC or Mac
Once you have them, simply log in to SharePoint online and open up the desired site. You need a document library to store documents and also relevant fields (metadata) to be created to match our quick parts (Date, Company Name, Project Name etc..).
In my case, I have a simple library with few metadata fields created as below.
Following fields in blue, are our quick parts that we will be linking with the SharePoint library fields. They can be belong to a content type (centralized) or a specific to an library, nevertheless we can use quick parts in a document so that anyone can easily fill them out as part of a process.
Once you have added columns in to the library (much more easier in Modern SharePoint experience!), create a new Word document in that library or if you already have a document, just upload it to the library (just drag and drop). my library is the default “Shared Document” and the columns are “Customer, Project name, Date, Project value”, just four, simple !
Once you have uploaded, open it from Word application as shown below.
From Word, direct to Insert –> Quick Parts –> Document Property –> Choose the desired field/s
Here I’m adding Customer field which looks like below once added.
You have to click on each spot where you want Quick part to be placed and it will insert accordingly. I have added some fields multiple times here which is perfectly fine. Normally, a single field value can be used in various location across a document.
Changes are usually saved automatically. If you notice the save icon on the top bar of Word Application. So just go ahead and close this now.
Let’s head back to our library and get started with building the Flow for this scenario. Its easier to work with any office 365 tool nowadays due to the ultimate UI enhancements Microsoft have recently done.
Click on Flow –> Create a flow, from the Library
You will now be redirected to Flow web site and you must sign in using your O365 account to be able to go ahead from here onwards.
Once you signed in, choose New –> Create from blank from the Microsoft Flow home page. Pretty simple right ?
Type in “Manual” and hit “Enter” to search. Select the “Manually triggered button” as shown below.
Next up, we have to choose our SharePoint action. Type in “Get File Content” and select the highlighted action to proceed.
On the trigger options, Choose appropriate input types to match your fields. Keep in mind that your trigger can be whatever you want it to be, in my scenario, I’m using a manual trigger which is easy for me to demonstrate the use case.
Now to format our input parameters in the trigger. In my case, I’m adding 4 input types (Date, text and number) according to the Quick Parts I have. You can have more or less, inputs based on your story.
Customer: Text Field | Amount: Number | Doc Date: Date | Project: Text
Next up, is to configure our 1st SharePoint action to act as we want. we have to bind our SharePoint library to the flow. Choose the site where you have the library from the dropdown. I am using SharePoint because, in this case that’s is where my data resides, but, you can use various other services such as Salesforce, or PowerApps to bring inputs in to the file. The idea of this post is to demonstrate that how data coming from (anywhere) can be automatically entered in to a Word document.
And select the document library from the listed ones. Leave “Infer Content Type” as Yes as well.
Now let’s add a new action here. Click on “New” and add the Create File SharePoint action as below.
This action will update the file properties when the flow is triggered. Select the Site address and folder path (Library). Define the File name by choosing the appropriate fields as you wish. File content should come from the File Content Action itself.
Once this is done, the Flow so far would look like this. make sure you map the fields properly so you wont have any errors during the first run. A positive first impression is something awesome you know that !!
Then, click on “New” and search for “Update file properties” SharePoint action from the list to add our next action.
In here too, we have to configure some parameters to reflect fields and quick parts appropriately. Choose the same site and libraries and Item ID should be “Item ID” from create file. I am using Customer Name field as the title here but its up to you to have your own choice.
DISCLAIMER NOTE: This is an enthusiast post and is not sponsored by Microsoft or any other vendor.
One thought on “Microsoft Flow in a real world scenario: using Office Quick Parts to fill out documents (Part 01)”
Pingback: Microsoft Flow in a real world scenario: using Office Quick Parts to fill out documents (part 02) – Microsoft Cloud Services & Technology Journal