---
title: "get random item · RUAL Documentation"
description: "Returns a random item from a array using crypto.randomInt."
canonical: https://docs.rual.nl/block-types/array/array_get_random_item
language: en
---

# get random item

This block is part of the [`array`](https://docs.rual.nl/block-types/array) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

### Type Selection Required

This block requires you to select the data type you want to work with. You must manually select the type using the type selector modal. To access the modal, click the white button on the block.

### Field Selection Required

This block requires field selection (out). You must manually select the fields you want to work with using the field selector modal. To access the modal, click the white button on the block.

Returns a random item from a array using crypto.randomInt.

- array required `array` The input array from which to extract a random item.

Outputs one uniformly random element of the array on the type-selected output pin (pin id value when no type is chosen), using a cryptographic random source, so each execution may pick a different element. An empty or missing array emits OUT_OF_RANGE on error and no item.

[get random item](https://docs.rual.nl/block-types/array/array_get_random_item) needs no wired pins for a minimal setup; it is configured on the block itself.

![Studio canvas example for the get random item block: typical wiring for get random item.](https://docs.rual.nl/canvas-examples/array_get_random_item.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple): feeds into this block. Gets the selected fields from the given object.

- [custom field](https://docs.rual.nl/block-types/object/object_get_custom_field): this block feeds into it. get the value of a custom field with a custom value block, or dynamic value.

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
