Issue
- The Liferay "Forms" headless API is deprecated.
It is discussed in detail here: https://liferay.atlassian.net/browse/LPS-125528 - The users could still want the functionality that was provided by these endpoints.
Environment
- Version: Liferay DXP 7.4 Quarterly Releases
Resolution
- You can use both the Java API or the JSONWS API.
See the following examples:
You can access the form values (with Java API) as follows:
You can also access theList<DDMFormInstanceRecord> ddmFormInstanceRecords = DDMFormInstanceRecordServiceUtil.getFormInstanceRecords(formId);
for (DDMFormInstanceRecord ddmFormInstanceRecord : ddmFormInstanceRecords) {
DDMFormValues ddmFormValues = ddmFormInstanceRecord.getDDMFormValues();
for(DDMFormFieldValue ddmFormFieldValue : ddmFormValues.getDDMFormFieldValues()) {
String name = ddmFormFieldValue.getName();
Value value = ddmFormFieldValue.getValue();
for(Locale locale : value.getAvailableLocales()) {
String valueString = value.getString(locale);
}
}
}ddmFormInstanceRecords
(with JSONWS API) as follows:
Note, that here, the result does not provide the field values.curl http://localhost:8080/api/jsonws/ddm.ddmforminstancerecord/get-form-instance-records \
-d ddmFormInstanceId={formId}
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In