---
schema_version: "1"
id: d9665a07d1bf878e1032973b63f41e5525f1ce5975855882655940d6a548cb8d
title: Read from Array
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/6.6/toolbox-variable-handling-read-from-array.md
canonical_url: https://docs.mulesoft.com/rpa-builder/6.6/toolbox-variable-handling-read-from-array
source_site: docs.mulesoft.com
content_type: documentation
content_hash: adb27a88359f5e87441f2c7b1a3ce414fe837ff893896f6d6aeaef030b487bda
description: MuleSoft Documentation Site
release: "6.6"
latest: false
---
---
product: RPA Builder
version: 6.6
---

# Read from Array

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The _Read from Array_ Action Step is used to access the content of an array.

You can either return a value at a certain point in the array via an index or return the whole array
as text. In the latter case, all values are listed as comma separated values.

The _Read from Array_ Action Step provides the read values from the array automatically as various
data types. You can decide later in the Workflow which data type you wish to use.

## Properties

**Get entire array as CSV** (Bool, default: false) If active, the whole array is returned as a
string in CSV format (comma separated values).

**Index to read at**\*(integer, > 0, default: 1) Position within the array where the content of the
array is to be read from. Indexing starts at 1.

Please make sure that the index entered is not greater than the total number of all elements within
the array.

## Inbound Variables

**Array to read from** (Array) The array that is to be read from.

The drop-down _Array to read from_ list contains all the arrays that have been created in the
Workflow so far. These can be _Workflow Based Variables_ or return arrays from the _Read from Excel
File_ Action Step.

**Index to read at**\*(integer, > 0, default: 1) Position within the array where the content of the
array is to be read from. Indexing starts at 1.

## Outbound Variables

The _Read from Array_Action Step automatically supplies four different return values. Each one
represents one of the possible data types. Depending on what you want to use the data for, you will
take a different data type. In a _Keystroke_, for example, you will use the data type _AsString_, or
if it concerns a number that you want to use to manage how often a _Loop_ is repeated, use the data
type _AsInt_:

- **Read from Array.AsString** (string) Return value as text

- **Read from Array.AsInt** (int) Return value as a whole number

- **Read from Array.AsDouble** (double) Return value as a floating-point number

- **Read from Array.AsBool** (bool) Return value as a Boolean value

Please make sure that the content of the value read from the array is compatible with the desired
data type.

For example, a character string such as "abc" cannot be converted into a meaningful integer number.

If you want to use the return value from the Read from Array Action Step in another in Action Step,
a pre-selection will be made for you as to which data types can meaningfully be used at this point.

The following table provides an overview of the result of converting the data types:

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>From / to</th><th>String</th><th>Int</th><th>Double</th><th>Bool</th></tr></thead><tbody><tr><td><p>String</p></td><td><p>unchanged</p></td><td><p>0</p></td><td><p>0</p></td><td><p>The strings True and true and all positive numbers &gt; 0 are True; all others give False</p></td></tr><tr><td><p>Int</p></td><td><p>unchanged</p></td><td><p>unchanged</p></td><td><p>unchanged</p></td><td><p>If Int ⇐0, false; if Int &gt;= 0 true</p></td></tr><tr><td><p>Double</p></td><td><p>unchanged</p></td><td><p>The decimal places are truncated</p></td><td><p>unchanged</p></td><td><p>If Double ⇐0, false; if Double &gt;= 0 true</p></td></tr><tr><td><p>Bool</p></td><td><p>unchanged</p></td><td><p>0</p></td><td><p>0</p></td><td><p>unchanged</p></td></tr></tbody></table>

Each row refers to an outbound data type, each column to the result of converting to the data type
in the column header.

## Wizard

The drop-down _Array to read from_ list contains all the arrays that have been created in the
Workflow so far. These can be _Workflow Based Variables_ or return arrays from the _Read from Excel
File_ Action Step.

If you select the checkbox _Get entire array as comma separated values_, the whole array will be
returned as a string. The individual values will, of course, be separated by commas. The text field
_Index to read at_ and its content are deactivated in this case.

The _Index to read at_ denotes the position within an array from which the content of the array is
to be read. The first element has the index 1. The index can also be mapped to a variable. Simply
click on the Pin symbol and select a suitable variable from the list. If you subsequently wish to
set the variable manually, click on the Pin symbol again and select None. You can then enter a value
manually in the input field. The input field and its content are deactivated if the checkbox above
it is selected.

## Example

For a detailed example, please refer to the description of the _Get Array Count_ Action Step.
