What are you trying to achieve?
I am following the Make Intermediate 2-1 exercise, unit 1 - the get function, to sort an array by item_name in descending order.
sort(array_name; desc; item_name). But the output is in ascending order, which is wrong.
When I switch from “desc” to “asc”, the output is in descending order,which is wrong again.
I expect sort(array_name; desc; item_name) to return a descending order output, and the sort(array_name; asc; item_name) to return an ascending ouput.
But my result is wrong.
Steps taken so far
Create a Parse Json with this test input,
{
“shopping_basket”: {
“date”: “2023-06-07T10:45:26.894Z”,
“items”: [
{
“item_name”: “Summer hat”,
“item_price”: 25,
“item_color”: “Brown”
},
{
“item_name”: “Basic T-shirt”,
“item_price”: 15,
“item_color”: “White”
},
{
“item_name”: “T-shirt with print”,
“item_price”: 20,
“item_color”: “Black”
},
{
“item_name”: “Leather boots”,
“item_price”: 70,
“item_color”: “Dark brown”
},
{
“item_name”: “Sports socks”,
“item_price”: 9,
“item_color”: “Black”
},
{
“item_name”: “Socks with logo”,
“item_price”: 8,
“item_color”: “White”
}
],
“order_id”: “order-123”,
“total_price”: 147
}
}
Connect Parse Json to Set Multiple Variables, see picture 2
But the output is wrong. See picture 3.