Issue Summary:
I am experiencing a data persistence issue with embedded data in a Constellation application, which is subsequently affecting an export to Excel functionality.
Details:
Embedded Data Persistence: I have a table displaying embedded data. When updating data via a modal action, the data appears in the table but is not committed to the backend until I explicitly click “Save for later” or “Submit” on the main assignment.
Export to Excel Failure: Because the data is not persisted to the backend immediately, the Export to Excel functionality returns no data. The export works correctly only after a manual “Save for later” or “Submit.”
I need the data to be persisted to the backend upon closing the modal/updating the table so that the Excel export works in real-time without requiring a full page save.
This is expected for all data collation in Pega applications, the one exception is UI Kit from '25 has an optional auto-save functionality.
Where I am curious, is how you have an “Export to Excel” button on an Embedded Table? This is not part of the embedded component so it sounds like you have a custom DX Component?
If so, could you not commit the flow action prior to exporting in your custom DX Component?
As @MarcCheong clarified, the json payload is sent to server while doing Save for later or Submit action is performed. I’m curious to know why you’re expecting the data to show in Export to Excel without saving the data. Do you have a copy for Embedded Data in Data reference for export to Excel to be shown?
Yes thats right @MarcCheong , we have a custom DX Component built for this export to excel func. So, we would have a simple table displayed with few fields. The users would click on +Add to add an entry into the table using a model action or alternatively do a bulk import of the data into the table.
We were able to implement the bulk import action without any issues. As part of our requirements, we should be able to perform the export to excel functionality as well from the data that is added to the table.
Since the data is not persisted, it doesnt export the expected data into the excel.
Also, we did try to perform a save/commit on the post processing of the model action. Though the data is getting persisted, we are getting this error: “Another requestor has updated the Case since it was last read. Please refresh the form and resubmit your changes.”
Think we are losing the lock on the case when performing an explicit save/commit on the model pop up flow action.
Why not do an explicit save/commit when they click Export? So call this directly from your component, then create the file? Post processing would be at the embedded level, not the Case level, so I can see why that would be problematic.
I would recommend that within your DX Component, as a user takes an action (such as editing in a modal), you detect (Try PCore PubSub API) and write a custom save action (such as the auto-save dx component in the Constellation UI gallery via the PCore Invoke Rest API), so you can control the state as the user adds new records.
As long as the etag is updated between REST calls, you should not observe the “Another requestor has updated the case since it was last read, Please refresh the form and resubmit your changes”
Ideally, if you want to obtain the data from the server (PCore getDataApiUtils), you will need to likely need to call a dedicated data page which writes your result-set into a spreadsheet.
Alternatively, if you’re attempting to obtain the data entered from the client side, you could utilize PCore.getStore().getState(), identify your container, and navigate into caseInfo > content identify your embedded data. Forewarning: Pulling against the redux store in this manner means you may be pulling data in an uncommitted state.