SVAQuest Member since 2012 87 posts
Tata Consultancy Services Ltd
Posted: 2 years ago
Last activity: 2 years 5 months ago

Sending mails with updated excel as an attachment - without work object

Hi All,

I need to run a batch to show the statistics in body of the email and attach an excel with supporting details while sending an email from Pega.


  1. Display the transaction statistics in the body of the mail (Completed – Using SendSimpleEmail activities, Correspondence rule with Data Grid and inline styles)
  2. Capture the data into excel from Data Page (Completed - I was able to capture the data from Data Page using the MSOGenerateExcelFile activity in an excel and store into the service directory of the Server)
  3. Send an email with statistics and supporting details in the excel (Looking for an optimal solutions)

With reference to the below link:

How to attach excel file to mail?…

1. Call MSOGenerateExcelFile - 1. Configure the excel 2. Created the Binary rule and upload the excel 3. Commented the Step 6 - To capture the pyFileSource into TemplateFile page

2. Property-Set - AttachmentLinksOpened.pxResults(<APPEND>).pxObjClass = 'Data-WorkAttach-File'

- AttachmentLinksOpened.pxResults(<LAST>).pyAttachStream = TemplateFile.pyFileSource

3. Page-New AttachmentPage ( Data-EmailAttachments)

4. Property-Set

- AttachmentPage.pyAttachment(<APPEND>).pyDecode == True
- AttachmentPage.pyAttachment(<APPEND>).pyName == "Sample.xls"
- AttachmentPage.pyAttachment(<APPEND>).pyReference == AttachmentLinksOpened.pxResults(1).pyAttachStream
- AttachmentPage.pyAttachment(<APPEND>).pyRemoveXML == False

Please let me know whether this approach is suitable to send an email without creating the WO. And I was not able attach excel and pass the correspondence rule using above approach and SendEmailWithAttachments activity respectively

Please let me know your suggestions to address the below scenario:

  1. Current implementation – I was using SendSimpleEmail activity and show the statistics in grid with the counts in the mail. Is it possible to send an excel as attachment using SendSimpleEmail Activities, if AttachementPage is passed as parameter. I tried, but it was not working. Any suggestions?
  1. If I need to use SendEmailWithAttachments activity to send an excel in a mail, How to pass the correspondence rule to this activities? I am not able to see any options to pass the correspondence rule as parameter for any of the SendEmail*** activtities?
  1. Using MSOGenerateExcelFile, the data is captured in excel and stored in the Service directory. How to attach the file from the service directory and send an email? But this option is kept as a last priority, as we may send around 300 plus email for one batch (including upload and download data in an excel)
Low-Code App Development Case Management
Moderation Team has archived post
Share this page LinkedIn