Random Item in List | ARRAY_SAMPLE

Syntax

ARRAY_SAMPLE( [value] )

Parameters

value
The ARRAY an item will be pulled from.

Return Value

A random item in VALUE or NULL if VALUE is not an ARRAY.

Description

Fetches a random item in an ARRAY.

Examples

ARRAY_SAMPLE([1, 2, 3]) # returns 1, 2, or 3
ARRAY_SAMPLE(DATE()) # returns NULL