Rename a pdf with the sender name and then save the mail attachment

Hi ,

I have 2 emails with attachment of PAN Card

I want to save these 2 pdfs in a folder which i can do using a for loop and save attachments activity.

But , before saving, i want the first pdf to be renamed with the sender name

Example:- First pdf coming from Anitha should be renamed as “Anitha”
Second pdf coming from Lalasa should be renamed as “Lalasa”

Can someone kindly help please

Yes, you can do that in a simple way @Lalasa_Mulakaluri

Check this steps

  1. Save attachments directly to a known location and make sure you have no files inside (or you need to retrieve the most recent files)
  2. Then get the username I mean sender name using mail.Sender.DisplayName
  3. Use move file activity with the file name as the one you got in the step 2
1 Like