---
title: "get weighted random · RUAL Documentation"
description: "Returns a random weighted item from the given array"
canonical: https://docs.rual.nl/block-types/array/array_get_random_weighted_item
language: en
---

# get weighted random

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).

Returns a random weighted item from the given array

- array required `array ` Array of objects, should contain `weight` key.

- object `object`

- weight `number`

Picks one object from the array with probability proportional to its weight field and outputs it on object with its weight on weight. Only object items whose weight is an actual finite number participate; numeric STRINGS are ignored. When no item qualifies the block emits NOTHING on either pin.

A typical wiring for [get weighted random](https://docs.rual.nl/block-types/array/array_get_random_weighted_item): the `object` out pin feeds [custom field](https://docs.rual.nl/block-types/object/object_get_custom_field).

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

### Version history

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