I’m very sorry to bother. I sincerely have read as much as I can, and just seem to be striking out. I’ve attached a snippet of an output structure I’m trying to use. It should be simple, I want the array sorted based on the score, and yet I have failed (or come closer to succeeding) so many times.
The above will output, but it’s not sorted correctly. The score value seems to be numeric in my interrogation of it. I’ve had odd successes where I take the output (JSON download) and moved scenarios pasting in the output and parsing it (to save on the scenarios to create it), and that function worked and seemed to sort correctly. Any help is welcome. Actually happy to pay someone for their time if they would be willing to have a brief Facetime/Zoom call. I’ve invested time in learning map and get functions, but don’t seem to be having any luck.
Thanks all for your consideration and thoughts. Desperate to get this working.
This answer is based on the context and information that you have provided.
Your current formula:
sort( 32.Array[] ; desc ; score )
is looking for a property called score directly inside each array item.
But in your JSON, score is inside an object called URLs, so Make never finds it.
The actual path is:
Array[] → URLs → score
Correct implementation
Open the “Set Variable” / “Tools” module where you are writing the formula.
Replace your formula with:
sort( 32.Array[] ; desc ; number(URLs.score) )
Explanation:
32.Array[] → tells Make which array to sort (from module #32 in your scenario).
desc → sorts from highest to lowest.
number(URLs.score) → follows the nested path into URLs, grabs score, and forces it to be numeric so sorting is truly numerical (not alphabetical).
Save the module.
What happens after
When this runs:
Make takes the array from module 32.
Looks at each item’s URLs.score value.
Converts it to a number.
Sorts the array so the highest score is first.
Final working formula (paste directly in your Variable value field):
Thank you for your response. Unfortunately, it is not under URLS, URLS expands to have a listing of URLS (small, medium, regular). Score is a separate item.