sort()
This Shortcut help you Sort items of a list
Description
input [list]
(e.g. ) ["bar","middle","foo"]
output [list]
(e.g. ) ["bar","foo","middle"]
Run reverse() after sort() to get an array in descending order
Feedback
Log in or sign up to leave feedback.
@iamsenthilprabu
Extremely useful :) Can you make this to work with the dictionary (based on keys!).
When I pass a list of keys, it works! But when I pass a dictionary, it just returns the same!
Can you make it work?
· 1 year, 8 months ago
· 1 year, 8 months ago
@fungland
Author
Thank you @iamsenthilprabu ! I made an example shortcut to demonstrate how to sort a dictionary by key.
https://www.icloud.com/shortcuts/2fc2b4418022454db39247fa50713bad
· 1 year, 8 months ago
· 1 year, 8 months ago
@iamsenthilprabu
Wow! Cool!
Thank you!
· 1 year, 8 months ago
· 1 year, 8 months ago
@iamsenthilprabu
I have a question: (not related to this shortcut directly)
- When I visit a website directly - I can see the JSON data in sorted!
- When I use the Get Contents of URL in shortcuts - It is giving me the same data in a different order.
I really don't know why? Any insight on this behavior?
· 1 year, 8 months ago
· 1 year, 8 months ago
@fungland
Author
An Object in Javascript is an unordered collection of properties.
· 1 year, 8 months ago
· 1 year, 8 months ago
@iamsenthilprabu
Thanks a lot for your response!
Your answers helped me a lot :)
Thank you, once again!
· 1 year, 8 months ago
· 1 year, 8 months ago