---
title: "count unique values · RUAL Documentation"
description: "Returns the number of unique items for the given array of values."
canonical: https://docs.rual.nl/block-types/array/array_count_distinct
language: en
---

# count unique values

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 the number of unique items for the given array of values.

- Array required `array` Input pin for the array of values for which you want to count unique items.

- Number `number` Output pin for the count of unique items in the array.

Counts distinct items by their TEXT representation, so values that print identically collapse into one (the number 1 and the string "1" count as a single distinct value). An empty, missing, or non-array input outputs 0.

[count unique values](https://docs.rual.nl/block-types/array/array_count_distinct) outputs how many different values an array holds. The example array has two items but only one unique value, so the number out pin outputs 1. Handy for dedupe checks before further processing.

![Studio canvas example for the count unique values block: counting unique values.](https://docs.rual.nl/canvas-examples/array_count_distinct.png)

### Version history

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