cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dallenap
Advocate I
Advocate I

Best method for checking if a file does not exist in SharePoint Library

Hello,

 

I have a flow that removes files from a SharePoint library.  It works fine as long as the file to be deleted exists.  However, if the file has already been removed the Get file properties action fails.  What's the best method for determining if the file to be deleted has been removed already and to skip the Get file properties action?

 

I've tried configuring an action after Get file properties to run after failure and this works okay but the Flow still reports as failed in the Flow Runs.

 

Thanks in advance for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
trad
Resolver II
Resolver II

You could end the flow with a Terminate action with Status set to "Succeeded" to make the flow run report as Succeeded in the flow runs.

trad_0-1614039229364.png

 

View solution in original post

2 REPLIES 2
trad
Resolver II
Resolver II

You could end the flow with a Terminate action with Status set to "Succeeded" to make the flow run report as Succeeded in the flow runs.

trad_0-1614039229364.png

 

View solution in original post

sudharsan1985
Super User
Super User

Hi @dallenap 

Use Scope action and add the Get File Properties inside it. Add another Scope action with the success or failure logic. In the Scope action settings you can Configure run after to say what should happen when the scope is successful or failed or skipped or timed out. Its basically like Try catch in the Power Automate. Try it and let me know.

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (77,316)