Support > Forums > OpenBots Studio > Compress file and Send email different variable types

Compress file and Send email different variable types

David Santos

  • Reporter
  • Calender Icon August 08,2021 at 6:12 AM

Hi Openbots experts, I have generated a zip file from a folder containing a couple of excel files using the "Compress Files" activity. The type of the output variable of the "Compress file" is a System.String. Then, I need to send an email an include the zip file as attachment. For this I used the "reply to outlook email" action which includes an "attachment file path" area. The type of these input variable Systems.Colletions.Generic.List, so when I try to pass the one generated by the compress file step an error of compatibility came up. How can the two variables be aligned to avoid this issue? Thank you in advance.

This forum has 314 topics, 681 replies, and was last updated 13 days ago by Support Agent

Nataly Alvarado...

  • Participant
  • Calender Icon August 10,2021 at 6:53 AM

Hello David,

Compressing the zip file generates a String variable to hold the path to the compressed file.

You can then send this zip file as an attachment by using the Send Outlook Email or Reply To Outlook Email commands. The attachment input is a List of Strings, because we provide you the option of sending multiple attachments at once. Which can only be achieved by referencing a list of file paths.

If you are only sending one attachment, you'll still need to include it as part of the list of strings. You can define the list in the attachment field itself, using the following format: new List<String>(){"PATH TO FOLDER"}.

Alternatively, you can use the Create List or Add List Item commands to define the list of strings and add the path value. Then, use this list as input for the attachment list field.

You are not authorized to reply, please click here to login and add your reply to this topic.