How sort data into ui_dropdown

Hi all.
A simple question.
There is a simple way to sort data into ui_dropdown node?
I store files hourly in order to view historical charts.
The files are named by date and time.
To select file I put a ui_dropdown node.
When the dropdown opens, it show files from months ago and is necessary to scroll the entire list to see the last file.
Is it possible to see the last file on the top, not the first?
BR

P.S : the dropdown shows only data that comes from another source. The SORT node can adjust the list as desired SORRY

Here is an example, had to guess your format as you give no examples

[{"id":"2073515d.335abe","type":"inject","z":"88fadd65b9040724","name":"","props":[{"p":"options","v":"[\"2021-12-4 10:32:00\",\"2021-12-4 11:32:00\",\"2021-12-4 12:32:00\"]","vt":"json"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":100,"y":840,"wires":[["c330be0.ed88fc","6b899d3c.9525f4"]]},{"id":"c330be0.ed88fc","type":"change","z":"88fadd65b9040724","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"options^(>$)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":840,"wires":[["6b899d3c.9525f4"]]},{"id":"6b899d3c.9525f4","type":"debug","z":"88fadd65b9040724","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"options","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":880,"wires":[]}]

Similar can be doe with function node using sort()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
I have never used the sort node but that should work to.

Hello.
Your suggestion is very useful.
I attach a sample code and debug window.
BR


Data directory sorted.json (2.1 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.