So I have a workfile that has multiple PDF files. I have to send an email with the text from one of the multiple PDFs at random. How is this done? I also have to attach a excel file
Hello @Selvam_Madhumitha_IT , Welcome to the forums.
Simplistically, this is how it might work:
Load your Excel sheet as DataTable - say DT_Files
Get the Count of the Rows of the DataTable - say pdfFileCount
Generate a Random number between 0 and pdfFileCount-1 . That is because the Rows collection in the DataTable starts at Zero.
So whatever the random number is, get the pdf file from that row:
randomPdfFilePath = DT_Files.Rows(**randomNumber**)("<your file path column name in Excel>") .ToString()
Use the randomPdfFilePath
in a PDF activity to open the PDF file, read it and send an email.
Hope this helps.