Hello,
I’m using the Get Outlook Mail Messages activity to read new email and save the attachements to a folder in my F:drive. I want to copy part of the file name and seach for that number is an excel sheet, each attachment will have different numbers.
So far I am able to get the mail and save them to the folder but cannot copy the number in the file name.
I had worked on a similar case.
I will give you a shallow view on this.
Run a loop on the downloads folder to save the filename of all attachments.
Now just do the string manipulation to get the data from the filename you want.
Do let me know if you are unable to do. i can share my workflow.
Also, provide us the filename example to help you with string manipulation
Use Directory.GetFiles(folderpath) to fetch the filenames from specified folder. You can also specify the file type if you want to retrieve only one type of files (Like, pdf or xlsx)
Iterate through the file names, get the required values from the filename and do required processing
NEW.xaml (10.9 KB) @chandu4712 see attached workflow. the file name is username-staffnumber.pdf, all i want to extract is the staffnumber, there will be at least 90 files to do this for. once the staffnumber is copied i want to search for it in a excel file to get a code then open the file and print.
I had assumed the filename as shown is the image in my earlier response.
You would definitely get an error because filename you are referring will be different.
I don’t have the file name format you are getting.
You have to design the data manipulation part according to the name.
Or let me know the format you are having
As you specified earlier i can understand that,
your filename is TEXT-1234567 TEXT is the Name of file at ‘0’ position 1234567 is the staffnumber at ‘1’ position
so in the sequence, in write line Activity, if you give filename(1) it will give you 1234567 as output.
So this should give you correct output. What exactly are you getting?