I think the slicing function on array in not working correctly.
I’m looking to sort reviews per creation time and display the first 6 of them in our collection.
The sort function does work nicely when I use the Desc parameter so that the lasted ones are on the top.
Unfortunately when I bind the slicing function on the array starting from 0 to 5 (6 first elements) the array starts at the index 1 (the second element).
@Alexis I am facing the same issue with “filter”, I want to slice 4 elements of an array of objects, I have applied a filter, and feels like the filter is also activated at the end, so my slice function only return 2 objects instead of 4. What function should I use in this case? I tried to play with the filter by key funtion but unsuccessfully.
Create a global formula named “Get Free Classes”, where you bind the collection and apply the filter
Then, use the formula combined with the slice slice(Get Free Classes(), 0,2)
This way, your filter will be applied before the slice