EnforceStructure (open)

Enforce a structure on a data

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION EnforceStructure(VARIANT expected, VARIANT received, RECORD options)

Parameters

VARIANT expected

Expected structure (and fallback values for non-record/array types). For records and arrays only types are used, records should have a template structure

VARIANT received

Data to normalize

RECORD options

Options

outofboundsvalue

Numeric value to use for numbers that are out of bounds for their expected type. Will be casted to the expected type, without bounds check.

BOOLEAN removeunexpected

If TRUE, remove all cells that aren't mentioned in the 'expected' parameter.

Return value

VARIANT

Normalized data

Description

Structure enforcing is useful to normalize incoming JSON data.