Hello all.
So, I've followed the blog-post regarding how to check if a file exists in a SharePoint Folder. (1) Solved: Check if file exists in Sharepoint folder - Power Platform Community (microsoft.com)
This works great, however the Flow status ends up as "Failed" even though it's run successfully.
Is there a way to suppress the Get Metadata step failure that is handled by a scope, or do I have to live with the flow kicking up failed statuses.
Solved! Go to Solution.
Ended up with this logic.
Do a Get Files (Properties Only) limited to the library and folder, as well as filtered on FileLeafRef (Filename) with a max count of 1. If 1 is found : Great! The file exists. If less than 1, it doesn't and continue the logic from there.
Thanks for putting me on the right path Bof!
Hi @LostLogic :
Do you want to check whether a file with the specified name exists in a certain SP library?
If so,I suggest that you can get all the files in this library first, and then filter the items by file name.If the result of the filter is empty, then the file does not exist.
I've made a test for your reference:
The result:
the file exist
the file does not exist
Best Regards,
Bof
This would be an excellent solution had it not been for the amount of files and non-guaranteed unique file names. I could probably filter on path as well, but getting all file properties in a document library on every run of a loop will slow down the flow significantly.
But! I think you've put me on the right path. I can use the Get Files (Properties Only) action to limit to folder and filter on name. If the count is equal to 0, I know it doesn't exist.
Thanks!
Ended up with this logic.
Do a Get Files (Properties Only) limited to the library and folder, as well as filtered on FileLeafRef (Filename) with a max count of 1. If 1 is found : Great! The file exists. If less than 1, it doesn't and continue the logic from there.
Thanks for putting me on the right path Bof!
Hi @LostLogic :
Thanks for your feedback.
Glad to hear that you solved this problem.
Beast Regards,
Bof
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
63 | |
27 | |
21 | |
15 | |
13 |
User | Count |
---|---|
123 | |
46 | |
44 | |
35 | |
31 |