Not certain, but I think this is not possible in the Listview itself. I think this should be done in the processing of the API-response before you feed the list to the listview.
This question is pretty similar to this one, https://forum.mendix.com/link/questions/101265, having pretty much the same answer.