Script Functions

The SCRIPT function in ORMB is used for conditional execution and data transformation in file uploads. It enables users to define control statements and execution blocks for mapping, validation, and transformation logic.

SCRIPT Function Structure

The SCRIPT function consists of two blocks:

Block Type

Description

Control Statement Block

[ … ]

Used for decision-making. Conditions within this block are evaluated from left to right.

Execution Block

{ … }

Defines the actions to be performed when conditions in the control block are met.

SCRIPT Function

Syntax

SCRIPT([Control_Condition],{Execution_Action})

Example

SCRIPT([EFFECTIVEDATE.isAfter(:CHAR_DATE)], {ERROR(90003,282,PERSONIDNUMBER,:CHAR_DATE,'Validation Error')})  

Operators in SCRIPT Function:Equality, Relational, and Conditional Operators determine whether one operand is greater than, less than, equal to, or not equal to another:

Operator Description Supported Data Type
= Equal to CHAR, NUMBER
!= Not Equal to CHAR, NUMBER
< Less than NUMBER
<= Less than or Equal to NUMBER
> Greater than NUMBER
>= Greater than or Equal to NUMBER
ISBEFORE Less than DATE
ISBEFOREOREQUAL Less than or Equal to DATE
ISAFTER Greater than DATE
ISAFTEROREQUAL Greater than or Equal to DATE
ISEQUAL Equal to DATE
ISNOTEQUAL Not Equal to DATE

Example:

This function throws an error if EFFECTIVEDATE is later than CHAR_​DATE.