2022.2

Table Of Contents
Ascriptcanbeusedtosetboundariesforadatasource(see"SettingboundariesusingJavaScript"on
thefacingpage).Thescriptdetermineswhereanewrecordstarts.
Scriptscanalsobeusedindifferentstepsintheextractionworkflow.Youcan:
l
Modifytheincomingdatapriortoexecutingtherestoftheextractionworkflow,viaaPre-
processor(see"Preprocessorstep"onpage249).
l
EditextracteddatainafieldoftheDataModelusingaPost functionscript(enteredontheStep
propertiespane,underFieldDefinition;see"Modifyingextracteddata"onpage268and"Extract
stepproperties"onpage326).
l
EnterascriptinaJavaScript-based field(see"Expression-basedfield"onpage265).Notethat
thelastvalueattributiontoavariableistheoneusedastheresultoftheexpression.Itispossible
torefertopreviouslyextractedfieldsiftheyareextractedhigherinthislistorinpreviousExtract
stepsintheextractionworkflow.
l
LetanActionsteprunaJavaScript,forexampleto:
l
Extractdatatofieldsattherootlevelorinadetailtable.SeeExtractingdatawithanAction
stepscript.
l
AddavaluetoacustompropertydefinedinthePreprocessorstep.(See"Propertiesand
runtimeparameters"onpage227.)Notethatonlythevalueofpropertiesofwhichthe
scopeissetto"Eachrecord"canbechangedinascript.
l
ChangetheleftandrightoperandsinaConditionsteptoaJavaScriptexpression.(OntheStep
propertiespane,underCondition,setBasedontoJavaScript;see"Conditionstepproperties"on
page347and"MultipleConditionsstepproperties"onpage349.)
l
Furtherprocesstheresultingrecordsetaftertheentireextractionworkflowhasbeenexecuted,
viaaPostprocessor(see"Postprocessorstep"onpage258).
ThescriptcanalwaysbewrittendirectlyinasmallscriptareaorintheEdit scriptdialog.Toinvokethis
dialogclicktheUse JavaScript Editorbutton .
IntheEdit scriptdialog,pressCtrl+SpacetobringupthelistofavailableJavaScriptobjects
andfunctions(see"DataMapperScriptsAPI"onpage360).Usethearrowkeystoselectafunc-
tionorobjectandpressentertoinsertit.Typeadotafterthenameofthefunctionorobjecttosee
whichfeaturesaresubsequentlyavailable.
Keyboardshortcutsforthescripteditorarelistedinthefollowingtopic:"Keyboardshortcuts"on
page953.
Page 363