> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# fill

> Reference for the fill workflow task, which fills the elements of an array with a static value from optional start and end positions.

The `fill` task fills the elements of an array with a static value. You can specify where to start and stop filling. If not specified, all elements are filled. This task overwrites (modifies) the original array.

## Potential use case

Use this task when you have a dataset and want to populate it with some unique values. For example, if you have a counter whose values need to be incremented over time, you could use the `fill` task to populate the counter with the new values.

## Properties

| Incoming | Type   | Description                                                                                        |
| -------- | ------ | -------------------------------------------------------------------------------------------------- |
| `arr`    | Array  | Required. The array to be filled.                                                                  |
| `value`  | Any    | Required. The value used to fill each element of the array.                                        |
| `start`  | Number | Optional. The index where to start filling the array. Defaults to `0` if not provided.             |
| `end`    | Number | Optional. The index where to stop filling the array. Defaults to the array length if not provided. |

| Outgoing      | Type  | Description                                                                                         |
| ------------- | ----- | --------------------------------------------------------------------------------------------------- |
| `filledArray` | Array | The modified array with elements filled as specified by the `value`, `start`, and `end` properties. |

## Examples

### Example 1

In this example:

* The incoming `arr` variable is set to `["1","2","3","4"]`.
* The `value` variable is contained in the `New Variable:Test` reference task, located in another workflow. The value provided is `[a,b,c]`.
* `start` and `end` were not provided, so defaults are used.
* The `filledArray` output is `[a,b,c],[a,b,c],[a,b,c],[a,b,c]` — each element of the incoming array is replaced with the value from the reference task.

![](/_fern-img/c0858c78ba23ea668d462cbc4700ca8bdb90ae367fee9113c7abdcbaac8225bc.webp)

### Example 2

In this example:

* The incoming `arr` variable is set to `["1","2","3","4"]`.
* The `value` variable is static with a value of `42`.
* `start` and `end` were not provided, so defaults are used.
* The `filledArray` output is `[42,42,42,42]` — the entire array is filled with `42`, replacing all initial values.

![](/_fern-img/40d82652ab46f157866a61a1750bc46955d0cf8a075f2ee3097f51f409834726.webp)

### Example 3

In this example:

* The `arr` variable is statically set to `["Toyota","Mazda","Datsun"]`.
* The `value` used to fill the array is statically set to `["Nissan"]`.
* Both `start` and `end` are statically set to `2`, so filling begins at position 2 of the array.
* The `filledArray` output is `["Toyota","Mazda","Nissan"]` — `Datsun` at position 2 is replaced by `Nissan`.

![](/_fern-img/e6793b1c76d8ad112004f7ba43c37989a2db8cd08e41b27e8fd29868f65397ae.webp)