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 / File ID is not valid -...
Power Automate
Answered

File ID is not valid - Static file link works, but variable does not.

(1) ShareShare
ReportReport
Posted on by 15

Hi All,

 

I have an issue where earlier today, the flow was working, however it stopped working.

 

I developed the remainder of the script with a static file address and it worked - then I tried to move it back to dynamic, and it failed again.

 

The script calls to use onedrive to copy a file from: /Apps/Microsoft Forms/Risk Assessment Submission/Question/<FileName.PDF>

 

with this as a static address, it works. I have a Parse JSON, which takes the information from the file being uploaded, the JSON output is here:

 

 

{
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "name": {
 "type": "string"
 },
 "link": {
 "type": "string"
 },
 "id": {
 "type": "string"
 },
 "type": {},
 "size": {
 "type": "integer"
 },
 "referenceId": {
 "type": "string"
 },
 "driveId": {
 "type": "string"
 },
 "status": {
 "type": "integer"
 },
 "uploadSessionUrl": {}
 },
 "required": [
 "name",
 "link",
 "id",
 "type",
 "size",
 "referenceId",
 "driveId",
 "status",
 "uploadSessionUrl"
 ]
 }
}

 

 

 

However, if I update the script to copy a file from: /Apps/Microsoft Forms/Risk Assessment Submission/Question/​<Body Name>, it fails to work. 

 

When it fails, however, it generates the error:

 

 

The file id '/Apps/Microsoft Forms/Risk Assessment Submission/Question/RA Fire Station Assessment_James Freeman 1.pdf' is not valid.

 

 

 

But When I open OneDrive, I browse to the directory path, then copy and paste the file name as it is in the error, I see the file there!

 

jeebob_0-1716572302195.png

 

If you look at the flow after completion, the error is:

jeebob_1-1716572375334.png

 

I don't understand why the file is there, the hardcoded file name works, but the variable name generates the same file path, but won't open.

 

Any advice that can be offered?

Categories:
I have the same question (0)
  • jeebob Profile Picture
    15 on at

    I have also tried to delete the existing "get file content" and "create new file" elements, and I have recreated them, with the same error / outcome.

  • Verified answer
    jeebob Profile Picture
    15 on at

    I found the problem. For some reason you have to use "Get File Content Using Path", as apparently "Get File Content" is not enough.

  • Suggested answer
    豊金-23120154-0 Profile Picture
    2 on at
    Hi I encountered exactly the same issue "File id is NOT valid" error when I used Get File Content or Get File Metadata on OneDrive for Business connector. The way I resolved is to use Get File Content with Path. I don't know why this action works. Anyway I am very glad.

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard