Pre-Action Data Transform and Activity Executing Again on Form Refresh or Field Change

Hello All,

Problem Statement:

Whenever the form is refreshed or any field is changed, the Pre-Action Data Transform and Activity are executed again

The issue is:

  • During Edit when the form loads, the Pre-Action Data Transform and Activity executed and populate some fields.
  • Manually change a value that was populated by the Pre-Action Data Transform or Activity.
  • If the form is refreshed, the Pre-Action Data Transform and Activity execute again.
  • As a result, the value entered by the user is overwritten with the value from the Pre-Action Data Transform or Activity.

For Example:

The Pre-Action Data Transform Sets User Type to New User

Manually change the User Type from New User to Existing User

If the form is refreshed, the Pre-Action Data Transform executes again.

As a result, the User Type is changed back to New User.

Because of this behavior, Unable to modify values that are populated by the Pre-Action Data Transform or Activity.

Has anyone faced a similar issue? If yes, could anyone please suggest the recommended approach to prevent the Pre-Action Data Transform and Activity from executing again during a form refresh?

As a quick fix, I would try adding a When pre-condition to the pre-action step to skip the override if not needed. Also, I’d be interested in knowing more about what is triggering the refresh and also whether you are using Constellation or traditional UI.

As a workaround, you can set a flag value after the pre-action and add a When condition to the subsequent logic.If the flag value is False, the logic will execute.If the flag value is True, the logic will be skipped.

However, this is only a workaround, and I’m not entirely sure why the logic is being triggered when the form is refreshed.

Could you please check whether pyRefreshDate is being used for any refresh-related logic? It would be worth checking the usage of pyRefreshDate once to see if it is contributing to the issue.

In Constellation, pre-processing Data Transforms are designed to set initial default values for fields. As Constellation operates via stateless API calls, a pre-processing Data Transform executes on every subsequent view refresh.

Set the value in the flow before assignment shape is a best practice, instead of using a pre-processing Data Transform on the assignment step, configure a Data Transform in the connector flow right before the assignment step. This ensures the code is generated exactly once and properly saved to the case. Also you can conditionalize as an alternative based on some value or flag as a work around.

Could you please confirm the Platform version? We haven’t seen this issue in 25.1.2. We’re setting the default values in the Pre Data transform and used Form Refresh Settings, but never seen the values overriden during Form Refresh settings

@KaviarasuP2205 In Pega Constellation DX API, this is expected behavior because the API is stateless.

Whenever a refresh API is called, such as when a field is changed or the form is refreshed, the Pre-Action Data Transform and Pre-Action Activity configured in the flow action execute again. These are executed on the clipboard data that had already persisted.

After that, the latest request from the UI is applied on top of the data. So, if the Pre-Action Data Transform sets User Type to New User, and the user changes it to Existing User, the refresh API will execute the Pre-Action Data Transform again. However, the latest value from the request should be considered after the Pre-Action Data Transform execution, and User Type should be updated to Existing User.

I would suggest checking the tracer to confirm the execution sequence and see which value is being applied at each step. Also, please check the refresh API request to verify that the latest User Type is being sent correctly.

One important point is that refresh does not persist the data to the database. The data is persisted only when the assignment action API is called during Submit. So, the Pre-Action Data Transform will execute again during refresh, but the latest submitted value should be persisted when the assignment action API is called.