Question
3
Replies
161
Views
Posted: December 18, 2018
Last activity: December 20, 2018
Pega API to export Propositions
We have a requirement to export proposition matrix from Pega as flat/excel file to client machine daily. The export should not be manual UI based.
Are there Pega APIs that export propositions for a given Issue/Group or for all Issues/Groups?
Thanks,
Sri
Per below pdn link, Reporting or Exporting of Propositions by pyIssue and/or pyGroup is an enhancement request.
https://community.pega.com/support/support-articles/export-propositions-pyissue-and-pygroup
I did a search and found out the following old solution (Using Excel Template and MSOGenerateExcel activity(XLSX)) . You can give a try.
You can use existing OOTB activity @baseclass.MSOGenerateExcelFile available in PRPC to generate excel spreadsheet in .xlsx format.
Create a template file (propositiontypetemplate.xlsx) with all the required fields. In this template hard code header names and provide placeholder tokens {.pyPropositions().pyCategory input}
for populating the data.
See screenshot #1 "propositiontypetemplate".
Upload this file as binary file under Technical category to create RULE-FILE-BINARY rule. Create a button on the data grid and call activity @baseclass.MSOGenerateExcelFile.
Pass following parameters.
FSFileName : "PropositionDetails.xlsx"
TemplateRFB : "excel!propositiontypetemplate!xlsx"
DownloadFile : checked
See screenshot #2 "Sample-output".
Benefits of this approach
· Output is an XLSX file , which is more structured. Hence reading and exporting such a file is much easier
· Easy to implement as the activity is already available in PRPC
· Any change in data grid will only need to change in template. No code changes required
· Template can be designed by the user as required
Limitations of this approach
· Because template is a static file it cannot be modified automatically when attributes are added. Hence it does not support dynamic updates in data grid structure attribute list.
· Because of dependency on baseclass, if there is any change in MSOGenerateExcel , it would need to relook at this implementation.
· Because it is a XLSX file it can be openned only in MS Excel 2007 and above. Older versions are not compatible.