Need help capturing txt file and deleting it

So i have 10 folder paths in Application WinSCP where I have to go and delete files. i am using UiPath to do that.
the problem I have is, I want the bot to go to the folder and check if any txt files exist in that folder inside the application. If there is any txt file, I want it to go ahead and proceed to next step which is deleting. But if there isn’t any, i want it to go ahead with other folder paths. I am trying to use images exists and captured that txt file symbol, which is not seeming to work. I also tried using element exists but using that I can only check with the name of the txt file not any txt file. So how can I do this so that it goes into that required path in the application and checks if there is any txt file and then delete those file. I have already created rest of the steps, but I wanted to make it faster as it was going to the delete option even if there were no text file which was wasting some time.

Hi @roshan.sapkota

You can consider using this package. It has activity to get files from folder.

Regards
Sonali

@roshan.sapkota

Ideally this is done through related activitirs and not UI..please check the same

Cheers