I have a process where any email with an attachment is saved and then printed, at the end there is a .txt file emailed, I would like to add a count of the saved attachments and how many got printed successfully to the txt file.
I have assumed a scenario where you have multiple mails with attachments and of different formats as docx, excel or pdf and you want to extract the data and store in text file, if this your scenario refer the below steps.
Use Get outlook Mail Messages
Use for each mail in collection of emails , save the attachments
Take the files from the location where the files are saved
Use for each file in array of files and get the extension and based on the extension read the text.
if the extension is pdf, use read pdf text with ocr, if the extension is docx, use read text of word, if extension is excel use read range.
Check if output length is greatMain.xaml (20.9 KB)
er than 0, then use append line activity to append the data.
When the append line is successful have a counter to increment.
You have to change the file path, where i have hardcoded the path
@anil5 All are PDF, I don’t need to extract any data from the files, they get saved to a location then printed. Its the count of the saved attachments I need.
@Palaniyappan thanks for this, I will give it a check
@Palaniyappan thanks again for this, I am able to run it and get the txt file, but the value comes out as (0), it needs to be able to count the attachments. Not sure if I’m missing something
No worries buddy, kindly rerun the same workflow that i sent you disabling or removing the first and last mail activities, you can check whether the value for {0} is passed or not in write line activity
Try this buddy lets check and sort this out
Buddy the text file is saved to a variable and we changed the value from {0} to 1 in that variable only, use a write text activity and pass that string variable as input, with new filepath where you can see the changed value as 1