Issue
Values from read-only fields on the UI form view are not submitted and therefore they are not persisted to the case if they are updated automatically.
Symptoms and Impact
Values from read-only fields on the UI form view are not submitted. This occurs when form refresh settings are configured to update a field on change of another, and the target field is set to read-only.
Steps to reproduce
-
Create a UI form view with fields ReferencesID, Value 1 and Value 2 .
-
Configure the Value 1 and Value 2 fields with an Edit mode of read-only.
-
Configure a flow action with Form refresh settings option set to update target fields Value 1 and Value 2 when the value of Reference ID changes - use Data Transform UpdateReferencesValues.
-
Update the value of Reference ID
-
Test the form refresh and Submit the form.
-
Values from the read-only fields are not updated or saved.
-
Review the properties in a subsequent view or go back to the original form.
-
Note that the values are blank.
Root Cause
This behavior is currently working as designed. The functionality is the same in both Traditional UI and Constellation, but Constellation uses a new
setting allowing users to set fields dynamically on the form view. The values from read-only fields are not included in the data submitted by the form.Solution
These symptoms can be avoided by implementing the best practice of using pre / post processing in the flow action.
To mitigate any problems, use one of the suggested configurations below:
Solution 1
Consider any form refresh update to a read-only field as "for display only". If the read-only value needs to be submitted, then this should be done in the flow action post processing to perform the same calculation as the form refresh setting on the data submitted with the form.
For further details, see Configuring post-processing for a Flow Action
Solution 2
Set the fields to be editable instead of read-only so that the values will be submitted from the form.
Solution 3
Include a hidden editable Text input for the read-only field in the form in addition to the read-only field.
This solution requires the creation of a simple hidden input DX Component. This allows you to have both the read-only and hidden editable input in the view, which means the value is submitted from the hidden input.
The input component from the Constellation design system supports a type property that can be set to 'hidden' so you can make this component by making this one change to the basic Text Input component that is created by the DX Component Builder.
For further details, see the below documentation:
Input | Pega Constellation design system
Constellation DX components (pega.com)
Solution 4
Use a declare expression instead of a form refresh setting.
For further details, see Declare Expression Rules
Related content
Configuring dynamic field behavior
Defining the run-time presentation of Flow Actions
[Constellation] Issue when save auto populated read only fields data in view