How to get downloaded file from Download Email Attachments

Hello,

Looking for some assistance with using the Download Email Attachments activity for MicrosoftOffice365 activities. The Download attachment works, however, I cannot seem to grab the file. When I created a variable for the Output of the activity it created an ILocalResource variable. I need to grab this file and move it to another location. It is putting the file in "C:\Users(username)\AppData\Local\Temp\something.pdf. There are a lot of files in my Temp folder. I know I could clear out the Temp each time, but isn’t there a way to either define the path for ILocalResource, or create some type of other variable that can grab this export file path? I tried referencing the Downloaded attachments list variable and the Email variable, but neither gives up the file source.

Here is what one of my tests looks like in the local Path screen. Any suggestions would be greatly appreciated.

Make a Folder. Try downloading file to a path. Make a variable for filename. Then
make filePath = folderPath + “/” + fileName.
I hope this helps. Let me Know

Hi @abhishek.gupta ,

The activity does not allow that. When you create the variable it sets it to ILocalResource. I tried a string variable for the folder path and it gives an error that string cannot be converted to ILocalResource.


FileName

Try Using Save Email Attachnment. Pass the folder path as a string.
image

@Kyle_Barton1

Even from the screnshot i can see the file name…you can actually get the filename from ilocalresource and use it further in your process to identify the exact file

Cheers

@Anil_G ,

How would I get that information for the ilocalresouce. I tried creating a variable but I cannot call ilocalresource in an assign activity. Doing ILocalResouce. brings up nothing.

@Kyle_Barton1

Ilocalresourcevariable.fullname should give the name of the file

Cheers

@Anil_G,
I the variable name is AttachmentList. ILocalResource is the variable type. Either way, .fullname does not work as the error states it’s not part of AttachmentList or ILocalResource.

@abhishek.gupta ,

The Save Email Attachments is part of Mail.Activities. I’m using MicrosoftOffice365 Activities because I am using Integration Services to trigger a unattended automation bot when a service account receives a specific email.

@Kyle_Barton1

This is how you access
image

The number zero is for first item…like that you can increment the number and get each item…

use this in a loop to get each as one item

Hope this helps

cheers

cheers

Thank you @Anil_G . I’ve never used the TypeArgument before so I didn’t know where to look. Now I can get the LocalPath and use the Move File to put it where it needs to go. Thanks again.

Kyle

1 Like

@Kyle_Barton1

Anytime…Happy Automation

Cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.