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.
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.
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!
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
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional