Using a collection for attachments

Daniel Teo

New Member
Hi, I'm facing an issue while attempting to attach multiple files to an email using a single column collection with the paths of the files to be attached in rows.
I'm getting the error message "Collection has no current row". Any idea why that would be happening?
 

Daniel Teo

New Member
I think you are trying to add data in empty collection, before adding data use Add row action from collection.
Thanks for the reply, but my collection was filled correctly with 3 rows of file paths. However, the error came up when trying to use the collection to attach the files to a SMTP Message.
 

gil.silva

Active Member
Hey Daniel,

How are you Looping the collection? Can you show the flow?

In these cases, you should Loop your collection and concatenate all the paths in a single Data Item, separated by a semicolon.
After the loop, you insert the Data Item as Input in the field Attachments (Send E-mail action).

Your concatenate stage, should be a calculation with the following format:
Attachment Collection.Path & ";" & [Attachments]

where:
Attachment Collection - name of your collection
Path - name of the collection Field with the paths
Attachments - Data Item type Text
 

Daniel Teo

New Member
Hey Daniel,

How are you Looping the collection? Can you show the flow?

In these cases, you should Loop your collection and concatenate all the paths in a single Data Item, separated by a semicolon.
After the loop, you insert the Data Item as Input in the field Attachments (Send E-mail action).

Your concatenate stage, should be a calculation with the following format:
Attachment Collection.Path & ";" & [Attachments]

where:
Attachment Collection - name of your collection
Path - name of the collection Field with the paths
Attachments - Data Item type Text

Hello Gil, thanks for the reply.

I'm currently saving the paths of the reports into a separate collection and using the collection itself as an input for sending the email. (refer to attachments for clarification)
Tried concatenating the paths into a data item as well, but since the object required a collection I contained it into a collection but it too just came out with the error of not having a current row.
 

Attachments

  • Collation.PNG
    44.9 KB · Views: 84
  • collation2.PNG
    7.8 KB · Views: 74
  • collation3.PNG
    5.7 KB · Views: 67

LilSisKin

New Member
I am having a similar issue but using exchange web services. I am using a loop with a collection to create the data item and getting the following error:
Could not execute code stage because exception thrown by code stage: The request failed. Could not find a part of the path '\\Company.com\data\Departments\Shared\Large-File-Transfer-Area\BluePrism\Lease Renewal Process\PDF Files to Email\Property - UAT November 2019 Utility Bill Back Notice.pdf;\\Company.com\data\Departments\Shared\Large-File-Transfer-Area\BluePrism\Lease Renewal Process\PDF Files to Email\Property - UAT November 2019 Offers.pdf;'.

Any ideas on this?
 
Top