Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Word Online Connector (Object reference not set to an instance of an object)


I'm trying to create a Word File by using the "Populate a Microsoft Word Template" action from Word Online (Business) Connector. After sucessfuly creating the template and making it recognizable by the Flow action, I tested it and received the following error: 

Object reference not set to an instance of an object
I've tried making the template file reside both in OneDrive for Business and Sharepoint Online, but had no success.
I'm populating the fields of the Word Doc using a Sharepoint List with the trigger "When a new item is created". Bellow is a screenshot of the Flow and the Error.





Error code says:

"error": {
"code": 500,
"source": "",
"clientRequestId": "df34166a-2586-4d34-bf47-0de5794ab8d2",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "Object reference not set to an instance of an object.\r\nclientRequestId: df34166a-2586-4d34-bf47-0de5794ab8d2",
"source": ""
Any Ideas?

Best Regards,




Accepted Solutions

@NickDewitt thank you! Your solution worked perfectly. Just adding a little bit for clarification: you must still save the document as a .docx document, not as an .docm (Macro-enabled document).

View solution in original post

Resolver II
Resolver II



I wrote a blog overview of the Word Online connectors. Check it out here:


Please give kudos and mark as the solution if it works!



Hi @danmitchell36 ,

Unfortunately, your link is down for me. I can't seem to access it.


Edit: I have followed exactly the steps you outlined and it still does not work. Do you have any other tips?

Best Regards,


@Dana I don't think you actually read his question, as your blog mentions nothing about the issue he is having.


We are also having the same issue with a word document, flow refuses to process the document template with an internal error of "Object reference not set to an instance of an object".


+1 to OP for a well written example of the problem.

@NickDewitt  I think you were not talking to me as I have not posted anything.  Could you have perhaps been talking to 'Dan' ?

Ah yeah sorry @Dana it offered @danmitchell36 and autocompleted to you!



I have used the Microsoft Word connectors on a number of projects and have never seen that issue before. While my post didn't address his issue directly I hoped that if he followed the instructions in the blog post he would be able to resolve the issue. 


Advocate II
Advocate II

@Gaiarsa I managed to fix this problem by deleting and re-inserting all content controls as plain-text (you can only utilise plain-text, combo and dropdown with this connector currently).


The document I am working on came from a 3rd party courier with a lot of content controls already inserted, we want to populate this document with data that we have in sharepoint etc.


Rather than manually removing and re-inserting all of the content controls, I wrote some vba to do it for me. Insert that into a module in the word vba editor and run it (F5), and you should no longer get this error. This obviously means the error was related to one or more of the content controls that were inserted (although I had already forced all to plain text before re-inserting and that didnt fix it).



Sub CleanseControls()

    Dim existingControls As New Collection
    Dim cc As ContentControl
    Dim newcc As ContentControl
    For Each cc In ActiveDocument.ContentControls
        existingControls.Add cc
    Next cc
    For Each cc In existingControls
Dim tag As String: tag = cc.tag Dim title As String: title = cc.title cc.Range.Select cc.Delete Set newcc = ActiveDocument.ContentControls.Add(wdContentControlText) newcc.title = title newcc.tag = tag
Next cc End Sub


@NickDewitt thank you! Your solution worked perfectly. Just adding a little bit for clarification: you must still save the document as a .docx document, not as an .docm (Macro-enabled document).

View solution in original post

Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,827)