Check downloaded attachment validity and delete it

Hi there,

I am downloading 6 excels and at the same time checking for validity of the excels. If one excel i wan it it be removed from the folder and keep the valid excels. How do i achieve this?

Hi @Mark_Rajkumar

You can use Delete File Activity to delete the file that did not pass the validity check. This takes a file name of the file to be deleted as input.

Hope this helps. Please provide more details otherwise

Thanks

Hi :wink:

() ACTIVITIES
“COMMENTS”
((CRITERIA TO DELETE))

DO THIS:

(For Each File in Folder) 
Then {
         (If) ((CURRENTFILE.NAME.contains("ER")))
          Then {
                   "TRUE"
                   (Delete File) activity
          }ELSE{
                    "FALSE "
          }
}

Grettings

Hi @Mark_Rajkumar How to define whether the excel is valid or no? For other steps try below

  • After excel files downloaded, get the files from the folder using below exp in assign activity
Var of type Array Of strings = Directory.GetFiles("fodlerpath","*.xlsx")
  • Use For Each activity to loop through each file
  • Within the loop, take IF activity to check the excel file is valid or no
  • Then block(if file valid) > Do Nothing
  • Else block(if file not valid) > Delete File using Delete File activity

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