Issue
-
The modified value of the FieldReference field of forms should also be updated in the database ddmforminstancereport entity once the user modified on form's UI.
Steps to reproduce:
1) Create a form
2) Add a 'Text' field
3) Navigate to the 'Advanced' tab of this field
4) Change text in the 'FieldReference' field
5) Publish form
Observed Behavior: In the database (ddmforminstancereport), the default string is still present, although, a modified value can be seen on UI in the field of FieldReference.
Environment
- Liferay DXP 7.4 Update 1
Resolution
- The observed behavior is the intended behavior of the Liferay DXP.
- The database was designed to meet the needs of DXP and could not be modified here.
If the field reference is added there, then every time a field reference changes, the rows of this table must be updated so that the data does not become obsolete.
- The field name is immutable and it was created for this kind of use case where the user needed a constant identifier. Please keep in mind that this table is also an auxiliary table that helps to plot the graphs inside Forms.
Additional Information
-
If the user wants to leverage the data inside of it, here’s a workaround that should work for them: firstly search for the field by its reference, capture its name, then use it to search the data inside this table.
- If users have access to their
DDMFormthey can try to use the getDDMFormFieldsReferencesMap method. This method returns a map with theFieldReferenceas the key. Then, it is possible to access the Field ID as follows:Map<String, DDMFormField> ddmFormFields = ddmForm.getDDMFormFieldsReferencesMap(true);
DDMFormField ddmFormField = ddmFormFields.get("FirstName");
String fieldID = ddmFormField.getName();This way users can use the
fieldIDinstead to get data from the posted form -
Therefore, to sum up, users are able to create a groovy script that would allow them to retrieve data from the table.
- If users have access to their
- We have a channel called "Global Service Team" in case of further assistance regarding any script, customization, and development.