How to reference file after renaming

I am downloading an attachment from an email using Office365 Download Email Attachments. I save the first attachment as a variable called current_attachment. It has some random name like “b3xlzfvu.djo.pdf”.

Then I rename the file to something like “Current File.pdf” using the System Rename File activity.

Now I want to attach the renamed file to an email using Office365 Send Email activity. I open the collection builder and add the variable name current_attachment.

But when I run the process, the Send Email activity fails, because it is looking for the original “b3xlzfvu.djo.pdf” file name instead of the new “Current File.pdf” file name. Is it possible to get the activity to use the new file name of the variable? Is there a way to “refresh” the variable to get the new file name?

Hi,

Can you share your current workflow (screenshot or file)?

Regards,

Here is the Rename and Send Email activities, with the Collection Builder and output error:

image

image

Hi,

Can you try to use PathExists activity for renamed file to get IResource of new file, as the following?
Probably it’s better to store full path of new file to a variable in advance.

Regards,

Thank you, this works.

1 Like

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