Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Pvt. Ltd
IN
Last activity: 26 Nov 2019 9:07 EST
Send Email with attachment excel
I have Requirement to copy the data of pagelist into Excel and copy each property into Excel file as a column. Then add that excel file as attachment into email and Send that email to multiple users.
Is there any OOTB to copy the data from pagelist into excel and attach excel file to email?
How to achieve this?
***Moderator Edit-Vidyaranjan: Updated Platform Capability***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Pvt. Ltd
IN
Thanks Bhavya for your reply. I used existing send report email functionality logic in pega and it is working now.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
Coforge DPA
GB
Hi
You can use "MSOGenerateExcel" activity to generate the excel and then use SendEmailWithAttachments activity.
Regards
Bhavya
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Pvt. Ltd
IN
Thanks for your reply. Now it generates excel file but how to add that excel as attachment to email. Because in SendEmailWithAttachment it is asking for attachment. So how to add that excel as attachment?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
Coforge DPA
GB
Hi
Can you try with below steps:
1. Create a new page "AttachmentPage" of class "Data-EmailAttachments".
2. Set the below properties on "AttachmentPage"
AttachmentPage.pyAttachments(1).pyName (Name of your to be attached)
AttachmentPage.pyAttachments(1).pyType (File extention)
AttachmentPage.pyAttachments(1).pyDecode to "True"
AttachmentPage.pyAttachments(1).pyData (Set your base64 encoded stream here)
3. Pass this page as parameter to AttachmentPage.(Check the exact parameter name in the activity)
Hi
Can you try with below steps:
1. Create a new page "AttachmentPage" of class "Data-EmailAttachments".
2. Set the below properties on "AttachmentPage"
AttachmentPage.pyAttachments(1).pyName (Name of your to be attached)
AttachmentPage.pyAttachments(1).pyType (File extention)
AttachmentPage.pyAttachments(1).pyDecode to "True"
AttachmentPage.pyAttachments(1).pyData (Set your base64 encoded stream here)
3. Pass this page as parameter to AttachmentPage.(Check the exact parameter name in the activity)
Regards
Bhavya
-
Mahesh Kothapally Venkatesh N
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Pvt. Ltd
IN
Hi Bhavya,
Thanks for quick response.
I have fetched all records from database based on filter condition using Report definition. I got all results on RequestPage.pxResults. I added this page as as step page while calling MSOGeneratedExcelFile activity and select download file checkbox. It download the excel and fetch the correct details in file. Now I need to add this excel file as attachment to email. Where is the file location.Can you please describe the above step briefly and exactly what parameter we need to pass to attach that file?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689968000/54c68a50-22c7-47d5-98f2-63df69104811.jpg?itok=I5MMyPJN)
Coforge DPA
GB
Hi
Try below steps:
1. Uncheck the download option.
2. Copy the excel content from the page to the AttachmentPage. And use that as parameter to "ReferencePage" param.
Regards
Bhavya
Accepted Solution
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Pvt. Ltd
IN
Thanks Bhavya for your reply. I used existing send report email functionality logic in pega and it is working now.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/acf9b3f6-41e7-4ef2-9e55-8da39714b54f.jpg?itok=JYQYUbWS)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/acf9b3f6-41e7-4ef2-9e55-8da39714b54f.jpg?itok=JYQYUbWS)
Pegasystems Inc.
IN
Thank you for updating the resolution! We have marked this post as Answered.