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 / Delete File from OneDr...
Power Automate
Unanswered

Delete File from OneDrive for Business

(0) ShareShare
ReportReport
Posted on by 14

Hi,

 

I apologise if this is already here somewhere and I missed it.  I am relatively new to Power Automate, as in I have made a few basic ones here and there but not a lot of complexity.

 

Anyway the basic concept is to have a Microsoft Form that employees can enter some basic details to, including added attachments.  On submission this triggers a flow that copies the data to a SharePoint List, including the attachments.  At its base level this is all working.  However I have two issues.

 

The first is I have two dates on the form and I cant work out how to test if they arent empty before I do a Convert Date Time on them.  I found a couple of examples using '@empty' but I just couldn't make it work.  For now I get around this using the Configure Run After option.  I just cant quite work out how to handle them being left blank at the moment?

 

The second is once the attachments are uploaded I want to delete them from OneDrive.  This is what I have so far:

WayneSingh_0-1601519886499.png

This is the error I am getting.

"status":400,"message":"The file id '/Apps/Microsoft Forms/Program Capture System/Question/shutterstock_1049916332_xxxx.jpg' is not valid.","source":"api.connectorp.svc.ms"

 

Any help, even just a link where to look would be greatly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @WayneSingh,

     

    The Delete file action accept File indentifer, not file path, you could use Get file metadata by path action to get file metadata, it will return ID:

    Screenshot 2020-10-01 151316.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • WayneSingh Profile Picture
    14 on at

    Thank you. I am not back at work until Tuesday so I will look into this then and let you know how it goes.

     

    Very much appreciated.

  • WayneSingh Profile Picture
    14 on at

    That was perfect thank you mate.  Exactly what I needed

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard