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

# count unique values on field

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

### Field Selection Required

This block relies on a field that you select to perform its data actions. You must manually select the field you want to use in your flow using the field selector modal. To access the modal, click the white button on the block.

Returns the number of unique items for the given field and its values.

- Array required `array` The array containing the items for which you want to count unique values.

- Number `number` The count of unique items for the specified field and its values.

Counts distinct values of the selected field across the object items, comparing by TEXT representation (values that print identically collapse into one). Items that are not objects or lack the field contribute nothing. Outputs 0 for a missing array or when no field is selected.

| `distinct` |
| --- |
| `cardinality` |

A typical wiring for [count unique values on field](https://docs.rual.nl/block-types/array/array_count_distinct_on_bp_field): the `number` out pin feeds [cast to value](https://docs.rual.nl/block-types/type%20casting/number_convert_to_value).

![Studio canvas example for the count unique values on field block: typical wiring for count unique values on field.](https://docs.rual.nl/canvas-examples/array_count_distinct_on_bp_field.png)

### Version history

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