cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JanP2018
New Member

error 400 "file id is not valid" when trying to delete a file

Hi, I'm having trouble finalizing a flow. What I want to do is the following:

  1. save zipped email attachments in a OneDrive for Business folder
  2. copy the zipped file to a SFTP folder 
  3. extract the zipped attachment on the SFTP 

Turns out that doesn't work as Flow doesn't support unzipping files on SFTPs.

 

So I changed that to:

  1. save zipped email attachments in a OneDrive for Business folder
  2. extract zipped email attachments to a different OneDrive for Business folder
  3. copy extracted file (CSV) to SFTP

That part works, using 2 flows (one for extracting the file, another for copying files to SFTP when a file is created in the OneDrive for Business folder.

 

However, it turns out the 2nd flow (copy to SFTP) is only triggered when the source folder was empty before the extracted CSV file was added.

 

I figured I could easily solve this problem by deleting all files in the CSV source folder, but that doesn't work, I keep getting the "400 file id is not valid" error. 

 

any ideas on how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions

I got the flow running reliably. It was an issue where the file's metadata was causing issues.

View solution in original post

4 REPLIES 4
v-yuazh-msft
Community Support
Community Support

Hi @JanP2018,

 

Could you please share a screenshot of the configuration of your flow?

 

The trigger "when a file is created" of OneDrive for Business connector would be triggered when a file is created in the OneDrive for Business folder, how would you mentioned that the trigger is only triggered when the source folder was empty?

 

And could you please share more details about the error message and run details of the flow when you delete all files in the CSV source folder?

 

Best regards,

Alice

 

 

Hey, @JanP2018!

 

It appears as though @v-yuazh-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

 

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



I got the flow running reliably. It was an issue where the file's metadata was causing issues.

View solution in original post

Anonymous
Not applicable

File Id being used instead of pathFile Id being used instead of path

 

I found this post very unhelpful when experiencing the same error.  The solution I found was to use id instead of reconstructing the path to the file as below [where the image files a wanted to delete were at /Flow Saved Emails/Attachements/]:

 

/Flow Saved Emails/Attachments/@{items('Apply_to_each')?['DisplayName']}

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,377)