How to get form fields values from a form using the scope in Alfresco Process Services

If you are adding custom code to your APS app, from the low code editor (activiti-app), and you need to access a specific field on your form, you can do it using the scope parameter, available from one of many customizable functions.

Use the following JavaScript code inside a form function to get the value from a field whose id is “field-id”. One of the function parameters must be scopethat will provide access to the fields.

scope.findFormFieldWithId(scope.allFormFields,"field-id").value

Some of the out-of-the-box functions that have scope as a parameter are listed as follows:

formRendered:function(form, scope)
formFieldValueChanged:function(form, field, scope)
formFieldFocus:function(form, field, scope)
formFieldBlur:function(form, field, scope)
formFieldPersonSelected:function(form, field, scope)
formFieldPersonEmailSelected:function(form, field, scope)
formFieldPersonRemoved:function(form, field, scope)
formFieldGroupSelected:function(form, field, scope)
formFieldGroupRemoved:function(form, field, scope)
formFieldContentUploaded:function(form, field, scope)
formFieldContentRemoved:function(form, field, scope)
formFieldRestValuesSet:function(form, field, scope)
formBeforeComplete:function(form, outcome, scope)
formTableFieldValueChanged:function(form, field, columnDefinition, editRow, scope)
formTableFieldFocus:function(form, field, columnDefinition, editRow, scope)
formTableFieldBlur:function(form, field, columnDefinition, editRow, scope)
formTableFieldRestValuesSet:function(form, field, columnDefinition, editRow, scope)
formTableRendered:function(form, field, columnDefinitions, editRow, scope)
formTableBeforeComplete:function(form, field, editRow, scope)
formTableBeforeCancel:function(form, field, editRow, scope)
formValidateFieldValueChanged:function(form, field, scope)
formValidateBeforeSubmit:function(form, outcome, scope)
formTableValidateFieldValueChanged:function(form, field, columnDefinition, editRow, scope)
formTableValidateBeforeComplete:function(form, field, editRow, scope)
taskCompleted:function(taskId, form, scope)
taskCompletedError:function(taskId, errorResponse, form, scope)
taskSaved:function(taskId, form, scope)
taskSavedError:function(taskId, errorResponse, form, scope)