Mastering Data Export in Pega: A Complete Guide to Using MSOGenerateExcelFileA
- Nov 19, 2024
- 2 min read

To export data from Pega to Excel using the OOTB activity MSOGenerateExcelFile, you can follow these detailed steps:
Steps to Export Data from Pega to Excel
Step 1: Create a Custom Activity
– Create a new activity: Name it DataExport.
Step 2: Call the OOTB Activity
– In your DataExport activity, use the Call method to invoke MSOGenerateExcelFile.
Step 3: Create a Binary File
1. Navigate to: Records → Technical → BinaryFile.
2. Click on Create.
3. In the Create Binary File Form:
– Label: Set as GetData.
– Application Name (Directory): Set as excel.
– File Type (Extension): Set as xlsx.
Step 4: Prepare the Excel Template
– Create an Excel file using a tool like Microsoft Excel.
– Define the structure: For example, in cell A1, you could enter:
“`
{TempPage.pxResults().property1}
“`
This will be used to populate the data from TempPage.
Step 5: Upload the Excel Template
– Upload the Excel file you just created to the Binary File record you created (GetData).
– Click Save.
Step 6: Set Parameter Values for MSOGenerateExcelFile
– In the DataExport activity, set the parameters for MSOGenerateExcelFile:
– FSFileName: Set to “GetData.xlsx”.
– TemplateRFB: Set to “excel!GetData!xlsx”.
– DownloadFile: Enable this option (set to true).
Step 7: Trigger the Activity
– Run the activity: You can link this activity to a button or a link in your user interface to allow users to trigger the export.
Notes
– Referencing Properties: Make sure to correctly reference properties in the Excel template to match the data structure you are exporting.
– Testing: Always test the activity in a development environment before deploying it to production.
By following these steps, you should be able to successfully export data from a Pega page to an Excel file, allowing users to download the file with the required information.
Share this post
