web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Word Online Connector ...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 26

Hello,

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.

Flow.PNG

 

Error1.PNG

 

Error code says:

{
"error": {
"code": 500,
"source": "flow-apim-msmanaged-na-northcentralus-01.azure-apim.net",
"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": "wordonlinebusiness-eus.azconn-eus-01.p.azurewebsites.net"
}
}
}
Any Ideas?

Best Regards,

Pedro

 

Categories:
I have the same question (0)
  • danmitchell36 Profile Picture
    268 on at

    @Gaiarsa,

     

    I wrote a blog overview of the Word Online connectors. Check it out here: https://www.dmcinfo.com/latest-thinking/blog/id/9838/overview-of-microsoft-flows-new-word-online-connectors

     

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

    Thanks,


    Dan

  • Gaiarsa Profile Picture
    26 on at

    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,


    Pedro

  • Ndewitt Profile Picture
    136 on at

    @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.

  • Dana Profile Picture
    6 on at

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

  • Ndewitt Profile Picture
    136 on at

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

  • danmitchell36 Profile Picture
    268 on at

    @NickDewitt,

     

    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. 

     

  • Ndewitt Profile Picture
    136 on at

    @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

     

  • Verified answer
    Gaiarsa Profile Picture
    26 on at
    @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).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard