New in 1.33.0 (BETA)

useDataLocator(dataLocator)

Evaluates a given DataLocator and returns a DataScope instance.

The function returns a DataScope, based on the choices the editor made. If the argument is null, undefined, or an empty datalocator attribute value (i.e. the editor has not filled it out yet), an empty DataScope is returned.

Params

dataLocator (DataLocator) – the value of a datalocator attribute of a CMS object.

Returns

A DataScope that enables application developers to interact with data referenced by the DataLocator.

If an error occurs while the DataLocator is being evaluated, an empty array is returned, and the corresponding error is made available via DataScope#getError.

Example

A widget that lists data: