I have the following output from an Array Aggregator. I want to sort it by Open Tickets
in ascending order:
[
{
"array": [
{
"Email": "Michael.Jones@company.com",
"Open Tickets": "1"
},
{
"Email": "Ray.Smith@company.com",
"Open Tickets": null
},
{
"Email": "Sue.Adams@company.com",
"Open Tickets": "2"
}
],
"__IMTAGGLENGTH__": 3
}
]
To do so, I’m using a Set Variable module with this expression:
{{sort(7.array; "asc"; "Open Tickets")}}
Yet the result is not sorted:
[
{
"sorted": [
{
"Email": "Michael.Jones@company.com",
"Open Tickets": "1"
},
{
"Email": "Ray.Smith@company.com",
"Open Tickets": null
},
{
"Email": "Sue.Adams@company.com",
"Open Tickets": "2"
}
]
}
]
I’m aware that Open Tickets
is a string in the Array Aggregator output. However, the Set Variable component says Open Tickets
is numeric, so I’d expect sort()
to handle it as a number.
Am I missing something obvious here? Thanks in advance!