A user may want to process the output from Detection Regions, as OCR services can return some false, inaccuratem or unintended results, such as some incorrectly recognized characters or extra whitespaces. With post-processing scripts, they can apply filters to strip unwanted characters and add mappings to correct undesirable results. Another possible case is that the user may wish to reformat or restructure the returned results. Adding a custom JS script enables the returned data to be tailored to whatever the user wants.
In a Form's editor, create a Detection Region. The active tab in the right bar will automatically be switched to "Labeller". Then change "Type" to "Script" as shown below: