I would like to know how to find the length of an array in an Amazon Step Function using only Amazon States Language and avoiding other AWS services like lambda etc.
Sample input to step function -
{
"SampleField" : "SampleString",
"SampleField2" : "SampleString2",
"SampleArray": [
{
"Name": "Jack",
"Age": 10
},
{
"Name": "John",
"Age": 18
},
{
"Name": "Mary",
"Age": 15
}
]
}
Sample output from the step function -
{
"LengthOfSampleArray" : 3
}
Please ensure that you don't invoke any lambda function or any other AWS service in the state machine.
Feel free to use as many states as you wish and any type of states.