Word Doc File Created Using Power Automate (Create SharePoint File Action) Will Not Open in Word Online

Anonymous
2022-09-16T14:43:48+00:00

I have a flow that takes a form response, notifies me of the form's completion and then creates a word doc in a SharePoint doc library. Everything works correctly. When I go to the doc library to open the word doc, however it throws an error (pictured below). It will not let me open the doc in word online.

I can select "Edit in Desktop App" and it opens just fine in the Word desktop app. After opening it in the desktop app and closing out of it, I still get the same error when trying to open the doc in word online.

Anyone know what needs to change to get docs made through power automate to open in Word online?

Picture of error:

My flow & the resulting file in the doc library is shown below:

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-09-17T03:31:23+00:00

    Dear Brock,

    Good day! Thank you for posting in Microsoft Community.

    The file content you defined in the File Content part in the Create File action may not be readable by Word for the web.

    As a workaround, you may create a content type in the document library as a template of the file creation, create a list to record the form information, insert the library property with the Quick Parts option into the content type and finally update the file property with the list field values and map the file property values to the template content. All the process can be completed by the flow as follows.

    For how to create a content type, you can follow the steps in Create or customize a site content type (microsoft.com).

    Note: The article is also applied to the modern content type UI.

    You can create the flow as follows.

    For the created file showed in Word for the web, the embedded property values may not be showed in Word for the web directly but it is showed in the Preview mode.

    You can format the Name column with the following JSON code for the users to preview the file in Word for the web.

    { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json","elmType": "a","txtContent": "@currentField","attributes": {"target": "_blank","href": "=if(indexOf([$ContentTypeId], '0x0120') >= 0, '?id=' + [$FileRef], @currentWeb + '/_layouts/15/Doc.aspx?sourcedoc='+ [$UniqueId] + '&action=interactivepreview')"}}

    Result:

    Thanks for your effort and time!

    Sincerely,

    Cliff | Microsoft Community Moderator

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful