Sort Array Content Alphabetically?

Any suggestions for how to automatically sort the contents of an array so that the elements appear in alphabetical (or alphanumerical) order?

1 Like

I’d be super curious if anyone has built this using the trigger editor in Tulip. This suggestion sounds like a perfect use for custom widgets + ChatGPT.

1 Like

Has a solution or workaround been found for sorting the contents of an array? (alphabetically or alphanumerically)

Hi Niklas,

Are you able to access an SQL database + SQL Connector? If so, you can write a simple SQL Query to take in an array joined into a string, and then output an array after sorting.

In the code below, I am also getting rid of duplicate entries.

I had the same challenge and resorted to triggers performing sorting by swapping elements in the array (which is silly). If we are to stick to standard functions and not program widgets to perform sorting maybe it isn’t such a big deal for the product team to add a “Sort array” action to the list of array functions. What is the Tulip product opinion on this?

image