# A better understanding of changing functions

:::note
From now on, the functions of the categories "Regular Expressions" and "Extraction" return an array by default. But it is possible to change the return type to a string when the function returns a single value.
:::

## 1. Encountered cases

## Case 1: I always want to retrieve values in an array

### 1. When I extract multiple values

The behavior does not change in this case because the extracted values will be returned in an array.

   <div class="docs-screenshot-compact">

   ![1 when i extract multiple values](./assets/1-when-i-extract-multiple-values.png)

   </div>

### 2. When I extract a single value

By default, when the returned value was unique, the function returned a string. Now, by default, the function returns an array containing a single value.

   <div class="docs-screenshot-compact">

   ![2 when i extract single value](./assets/2-when-i-extract-single-value.png)

   </div>

## Case 2: I always want to retrieve a single value as a string

The addition of the "Unwrap Single Value" option now allows for the extraction of a single value to define that the output type should be a string.

   <div class="docs-screenshot-compact">

   ![Case](./assets/case-2.png)

   </div>

⚠️ If I've selected this option and the function returns several IPs, it will automatically return an array of strings.

## 2. Unexpected behavior

Therefore, it is necessary to check if the expected type is consistent with the type returned by the function. The type can now be either a string or an array.
