Sort table alphabetically

I’m using bubble’s new table element. And I would like to order my table using elements other than text. Or sorting the table using data that is coming from another database. For example: within my User database, I have a database associated with the user in the form of a list called Addresses. I wanted to sort my table, using javascript, by city name in alphabetical order.

I’m using the toolbox plugin that gives the option to run javascript. I’m passing as paramlist1 my list that I want to sort. This was my code:

users = paramlist1
users.sort((a, b) => a.city.localeCompare(b.city))

But it is not returning any data to me. Has anyone tried a solution for this?