---
title: "avg on field · RUAL Documentation"
description: "returns the avarage number for the given field in the given array of objects."
canonical: https://docs.rual.nl/block-types/array/array_avg_on_bp_field
language: en
---

# avg 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 avarage number for the given field in the given array of objects.

- Array required `array`

- Number `number`

Sums the selected field over the object items (missing or non-numeric field values count as 0) and divides by the TOTAL array length, including non-object items and items lacking the field. Outputs 0 when the array is empty or the selected field is not of type number or date.

| `average` |
| --- |
| `mean` |

A typical wiring for [avg on field](https://docs.rual.nl/block-types/array/array_avg_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 avg on field block: typical wiring for avg on field.](https://docs.rual.nl/canvas-examples/array_avg_on_bp_field.png)

### Version history

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