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

Notifications

Announcements

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 with OneDrive fails with error "The selected file doesn't exist"

(2) ShareShare
ReportReport
Posted on by 31
I'm posting this problem for the benefit of others as I wasn't able to find anything on this topic, but did manage to solve it (took me about a week with help from others)...
 
Problem Description:
I have a Power Automate Flow that will populate a MS Word Template and PDF the template.  I can't use SharePoint due to company restrictions in using SharePoint for GxP use, so my MS Word template file is stored in Dataverse.  My flow goes through the following steps:
  1. Download template file from Dataverse.
  2. Create the template file in OneDrive as a tmp file (the OneDrive of the user running the flow - this will be important later).
  3. Word Online Populates the template
  4. Delete the tmp File in OneDrive
  5. Create the populated file in OneDrive as a tmp file.
  6. Word Online Converts the file to PDF
  7. Delete the tmp File in OneDrive
 
For reference for # 3 & 6 above my initial (Erroneous) parameters were as follows:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
With this configuration, when the Developer tests the flow, it will work, however when any other user attempts to run the flow Steps 3 and 6 will fail. with the following error:
 
The selected file doesn't exist, please select a valid file and drive.
 
Cause:
With the above configuration, the "Document Library" parameter is the problem.  The default selection of "OneDrive" is not the OneDrive of the user running the flow!  Rather selecting "OneDrive" will hard code the connector to the OneDrive of the DEVELOPER!  Thus the flow fails when other users run the flow because the Word Online Connector is looking for the file that was just created by the flow in the OneDrive of the DEVELOPER, when in fact by using the "Create File" function of the OneDrive connector, the temporary file is being created under the OneDrive of the user running the flow.  With these settings, Word Online will never actually find the file because it is looking in the wrong place.
 
Solution:
To solve this, the "Document Library" parameter must be dynamically set to reflect the OneDrive of the user running the flow.  This can be done using the "File Locator" output from the step to create the file in OneDrive as follows:
 
split(outputs('Create_file')?['body/FileLocator'],'.')[0]
 
 
Categories:
I have the same question (0)
  • Verified answer
    JoshGlenn Profile Picture
    31 on at
    The Post is the answer :)
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
    HI
     
    No need to shout just because you don't understand how things work...
     
    The developer setup the connection. You didn't enable it to be run as the User, so it doesn't.
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard