A submission's fields can be accessed and managed with the standard submission.fields
object.
all()
This method is available to server-side scripts.
Returns an array of Field objects corresponding to the submission's fields.
submission.fields.all()
any_errors()
This method is available to server-side scripts.
Returns a boolean value indicating whether any errors are currently initialized for the submission.
if (submission.fields.any_errors()) {
console.log("errors detected")
}
empty_errors()
This method is available to server-side scripts.
Removes all current errors from the submission.
submission.fields.empty_errors()
find(field_name)
This method is available to server-side scripts.
Finds a field by either its variable name or name. It will first check for any fields matching the variable name, then any fields matching the Field Name. If valid, the name will also be accessible from submission.fields directly. Returns a Field object or undefined.
submission.fields.find("field_name")
submission.fields.find("Field Name")
submission.fields.field_name
submission.fields.field_name.value()
find_by_column_name(field_name)
This method is available to server-side scripts.
Finds a field by its snake cased column_name. If valid, the name will also be accessible from submission.fields directly. Returns a Field object or undefined.
submission.fields.find_by_column_name("field_name")
submission.fields.field_name
find_by_name(name)
This method is available to server-side scripts.
Finds a field by its human-readable Field Name. Returns a Field object or undefined.
submission.fields.find_by_name("Field Name")
first()
This method is available to server-side scripts.
Returns the first field in the submission.fields.all() array.
submission.fields.first()
last()
This method is available to server-side scripts.
Returns the last field in the submission.fields.all() array.
submission.fields.last()
second()
This method is available to server-side scripts.
Returns the second field in the submission.fields.all() array.
submission.fields.second()
third()
This method is available to server-side scripts.
Returns the third field in the submission.fields.all() array.
submission.fields.third()