---
description: functions to operate with JSON array
---

# pdk.flow.JsonArray

### All functions

* [addBoolean](#addboolean)
* [addFloat](#addfloat)
* [addInteger](#addinteger)
* [addString](#addstring)
* [addJsonObject](#addjsonobject)
* [addJsonArray](#addjsonarray)
* [setBoolean](#setboolean)
* [setFloat](#setfloat)
* [setInteger](#setinteger)
* [setString](#setstring)
* [setJsonObject](#addjsonobject)
* [setJsonArray](#addjsonarray)
* [removeItem](#removeitem)
* [removeAll](#removeall)
* [mappingToVariable](#mappingtovariable)

***

### addBoolean

adds new element with type Boolean to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value :: [pdk.core.Boolean](../../../../structures/pdk.core#boolean)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Boolean = true

<strong>addBoolean(jsonArray, value) :: Void ->
</strong>jsonArray = [true]
value = true
</code></pre>

***

### addFloat

adds new element with type Float to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value :: [pdk.core.Float](../../../../structures/pdk.core#float)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Float = 3.1415

<strong>addFloat(jsonArray, value) :: Void ->
</strong>jsonArray = [3.1415]
value = 3.1415
</code></pre>

***

### addInteger

adds new element with type Integer to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value :: [pdk.core.Integer](../../../../structures/pdk.core#integer)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Integer = 100

<strong>addInteger(jsonArray, value) :: Void ->
</strong>jsonArray = [100]
value = 100
</code></pre>

***

### addString

adds new element with type String to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.String = 'Amsterdam'

<strong>addString(jsonArray, value) :: Void ->
</strong>jsonArray = ['Amsterdam']
value = 'Amsterdam'
</code></pre>

***

### addJsonObject

adds new element with type JsonObject to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value ::[ pdk.net.JsonObject](../../../../structures/pdk.net#jsonobject)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.JsonObject = {
    address: 'Korte Ouderkerkerdijk'
}

<strong>addJsonObject(jsonArray, value) :: Void ->
</strong>jsonArray = [{
    address: 'Korte Ouderkerkerdijk'
}]

value = {
    address: 'Korte Ouderkerkerdijk'
}
</code></pre>

***

### addJsonArray

adds new element with type JsonArray to the input array.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* value :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.JsonArray = [{
    address: 'Korte Ouderkerkerdijk'
}]

<strong>addJsonArray(jsonArray, value) :: Void ->
</strong>jsonArray = [[{
    address: 'Korte Ouderkerkerdijk'
}]]

value = [{
    address: 'Korte Ouderkerkerdijk'
}]
</code></pre>

***

***

### setBoolean

replaces the existing element with a new element of type Boolean.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value :: [pdk.core.Boolean](../../../../structures/pdk.core#boolean)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [1, 'Amsterdam', 3.1415]
position :: pdk.core.Integer = 1
value :: pdk.core.Boolean = true

<strong>setBoolean(jsonArray, position, value) :: Void ->
</strong>jsonArray = [1, true, 3.1415]
value = true
</code></pre>

***

### setFloat

replaces the existing element with a new element of type Float.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value :: [pdk.core.Float](../../../../structures/pdk.core#float)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [1, 'Amsterdam', false]
position :: pdk.core.Integer = 1
value :: pdk.core.Float = 3.1415

<strong>setFloat(jsonArray, position, value) :: Void ->
</strong>jsonArray = [1, 3.1415, false]
value = 3.1415
</code></pre>

***

### setInteger

replaces the existing element with a new element of type Integer.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value :: [pdk.core.Integer](../../../../structures/pdk.core#integer)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 'Amsterdam', false]
position :: pdk.core.Integer = 1
value :: pdk.core.Integer = 100

<strong>setInteger(jsonArray, position, value) :: Void ->
</strong>jsonArray = [3.1415, 100, false]
value = 100
</code></pre>

***

### setString

replaces the existing element with a new element of type String.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.String = 'Amsterdam'

<strong>setString(jsonArray, position, value) :: Void ->
</strong>jsonArray = [3.1415, 'Amsterdam', false]
value = 'Amsterdam'
</code></pre>

***

### setJsonObject

replaces the existing element with a new element of type JsonObject.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value ::[ pdk.net.JsonObject](../../../../structures/pdk.net#jsonobject)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.JsonObject = {
    address: 'Korte Ouderkerkerdijk'
}

<strong>setJsonObject(jsonArray, position, value) :: Void ->
</strong>jsonArray = [3.1415, {
    address: 'Korte Ouderkerkerdijk'
}, false]

value = {
    address: 'Korte Ouderkerkerdijk'
}
</code></pre>

***

### setJsonArray

replaces the existing element with a new element of type JsonArray.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)
* value :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)

Result:

* No variable is returned. An array contains a new element.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the index is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.JsonArray = [{
    address: 'Korte Ouderkerkerdijk'
}]

<strong>setJsonArray(jsonArray, position, value) :: Void ->
</strong>jsonArray = [3.1415, [{
    address: 'Korte Ouderkerkerdijk'
}], false]

value = [{
    address: 'Korte Ouderkerkerdijk'
}]
</code></pre>

***

### removeItem

removes the element at a specific position from the jsonArray.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* position :: [pdk.core.Integer](../../../../structures/pdk.core#integer)

Result:

* No variable is returned. An array without an element removed from the specified position.

Possible exceptions

* [IndexOutOfBoundsException](../../../exceptions/runtime-exceptions#indexoutofboundsexception) - throws if the position is greater than the length of the jsonArray
* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array or the position is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1

<strong>removeItem(jsonArray, position) :: Void ->
</strong>jsonArray = [3.1415, false]
</code></pre>

***

### removeAll

removes all elements from the jsonArray.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)

Result:

* No variable is returned. An array is empty.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input array is `NULL`

Example:

<pre class="language-json"><code class="lang-json">jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]

<strong>removeAll(jsonArray) :: Void ->
</strong>jsonArray = []
</code></pre>

***

### mappingToVariable

assigns the JSON Array data to a variable.

Arguments:

* jsonArray :: [pdk.net.JsonArray](../../../../structures/pdk.net#jsonarray)
* variable :: [pdk.core.Array](../../../../structures/pdk.core#array)<[UserObject](../../../../structures/pdk.core#userobject)>

Result:

* No output. The variable is initialized.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws if the input jsonArray is `NULL`
* [JsonMapException](../../../../structures/pdk.ex#jsonmapexception) - throws if the jsonArray item structure can not be mapped to the variable array item structure&#x20;

***



