How to check if same file already exist in sharepoint

Hi , I am handling sharepoint automation …I have to move file from one folder to another in sharepoint , but before moving the file I need To check if same file is already exist or not in the destination folder. If already exist then need to replace.


as shown in the screen shot My query is how to check if file already exist in 06182023 folder in sharepoint

Hi @Neha_Aggarwal1

The following thread might help you with this:

Best Regards.

I am using microsoft office 365 activities for sharepoint …

@Neha_Aggarwal1

Use find files or folders on the destination folder with the filename as query…if something is returned in the results then its present…if not it is not present…results.count will help in understanding if something is returned or not

Actually if you need to replce only…then directly use upload file and you have an option replace…so if present it would be replaced …if not a new file is uploaded

Hope this helps

Cheers

i need to do move the file from “source” folder to this “06182023” folder(runtime todays date folder) But the condition is if same file already present in the 06182023 folder then I need to do replace while applying move file action

@Neha_Aggarwal1

Then first use find files /folders…if found then delete the file using delete file activity

If not found in else side do nothing

After if activity use move file actovity

Cheers

thanku for help, its done maked solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.