How can I extract the file name from the attachment (which is a CSV file) and then put into a datatable using Read CSV to process further?
File names have no pattern
Every time the file needs to be saved in the same folder
Action to be done on the latest file which is been saved by current process transaction.
If you are saving the attachment from email to specific folder then sort the folder file as per the latest modified date and later pick that file for current process transaction.
I would recommend to use another folder such as “done” to transfer the processed files after each processing with move activity, therefore you will not depend on a risky procedure, instead you will only have recent files to work with on the dedicated folder.
You can have a file exist activity into a state machine (or a do while ) checking every 5 - 10 min if there is a new file on your folder.