Hi Power Automate experts
I am trying to make a flow for deleting a file from sharepoint, through power app. In the app, I have the file name.This is where I am right now.
Could anyone help me from here..
Thanks.
Hi @SearchingYT
You could do something like this:
1) Get those files in SharePoint that have the filename specified in Power Apps, using an OData Filter Query.
2) If an item is found: length(body('Get_Files_(properties_only)')?['value']) > 0
2.1.) Get the first item, and read its ID to get the details: first(body('Get_Files_(properties_only)')?['value'])?['ID']
2.2) Delete the file through the File Identifier property.
The most important thing to understand is that the "Get Files" could return more than 1 item, although it's supposed not to have repeated files with the same filename. Then, we get the first element (first function), avoiding the use of an "apply-to-each".
Hope it helps!
Ferran
Greetings: I'm trying to do the same thing but what I haven't got quite right yet is the OnSelect formula in a PowerApps button to trigger this flow. For a context variable filename in the app I tried:
DeleteFileFlow.Run(filename)
but I get a syntax error telling me that Run expects two parameters and I've only provided one. Some articles I've found suggest that I have to add a filter query but in this case the first() function does all the filtering I need. So how do I call this flow from the app?
Thanks!
OK, I finally figured out that the number of input parameters has to equal the number of places in the workflow that you specifically apply "Ask in PowerApps " to define an input. Pretty obvious once you see it but I'm still learning!
Any way thanks for the good article about deleting files by name.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Chiara Carbone as our Community Spotlight for November…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 614 Super User 2025 Season 2
Tomac 401 Moderator
chiaraalina 282