These helpers provide some ability to query and manage objects.
- Helpers.Object.GetIndex
- Helpers.Object.GetLength
- Helpers.Object.Max
- Helpers.Object.Min
- Helpers.Object.ToJson
| Summary | Gets the index of an object in an array |
| Returns | The index of the object if found |
| Remarks | If input is not an array, this will return nothing |
| Parameters | |
| input | Array to get index of |
| object | Object to lookup index of |
Context
{
"array": [
"one",
"two",
"three"
]
}Usage
Returns
<strong>result:</strong>
1
0| Summary | Gets the length of an array |
| Returns | Number of elements in the inputted array |
| Remarks | If input is not an array, this will return 0 |
| Parameters | |
| input | Array to get length of |
Context
{
"a": [],
"b": [
"one",
"two"
],
"c": [
1
],
"d": [
{
"id": 1
},
{
"id": 2
}
]
}Usage
Returns
<strong>result:</strong>
0
2
1
2| Summary | Returns the maximum value of a property inside of an array of objects |
| Returns | The maximum value found |
| Remarks | If input is not an array, this will return nothing |
| If no property is passed in, this will return the maximum value of the array that is passed in | |
| Parameters | |
| input | Array to search |
| property | Property to match on |
Context
{
"array": [
1,
2,
3
]
}Usage
Returns
<strong>result:</strong>
3Context
{
"array": [
{
"id": 1,
"name": "test1",
"type": {
"id": 4,
"name": "type1"
}
},
{
"id": 2,
"name": "test2",
"type": {
"id": 5,
"name": "type2"
}
},
{
"id": 3,
"name": "test3",
"type": {
"id": 6,
"name": "type3"
}
}
]
}Usage
Returns
<strong>result:</strong>
3
6
type3| Summary | Returns the minimum value of a property inside of an array of objects |
| Returns | The minimum value found |
| Remarks | If input is not an array, this will return nothing |
| If no property is passed in, this will return the minimum value of the array that is passed in | |
| Parameters | |
| input | Array to search |
| property | Property to match on |
Context
{
"array": [
1,
2,
3
]
}Usage
Returns
<strong>result:</strong>
1Context
{
"array": [
{
"id": 1,
"name": "test1",
"type": {
"id": 4,
"name": "type1"
}
},
{
"id": 2,
"name": "test2",
"type": {
"id": 5,
"name": "type2"
}
},
{
"id": 3,
"name": "test3",
"type": {
"id": 6,
"name": "type3"
}
}
]
}Usage
Returns
<strong>result:</strong>
1
4
type1| Summary | Gets a serilized json representation of the object passed in |
| Returns | Json object representing input |
| Remarks | If input is null, this will return null |
| Parameters | |
| input | Object to serialize |
Context
{
"a": [],
"b": [
"one",
"two"
],
"c": [
1
],
"d": [
{
"id": 1
},
{
"id": 2
}
]
}Usage
Returns
<strong>result:</strong>
[{"id":1},{"id":2}]