Home › Forums › Add-ons › Repeater Field › Sorting data from api › Reply To: Sorting data from api
@hube2 I’m sorry for not fully explaining.I will detail it right away. The sample json content I got from api is as follows:
As you can see there is a value called leaguePoints. In my codes above, I transfer the leaguePoints value I got from json to the point1 variable.
The screenshot you see below is my repeater content:
Let me explain the pool name field. Users are registered with these names in the system where I receive data with API. That’s why I write the user name they registered in the system into this pool_name field. I get the user data by assigning the value entered in the field to the api url in the codes you see above.
And the result is as in the screenshot I shared below:
I get results as I wrote from the admin panel. All I want is to sort the numbers in the variable point1 in descending order.
Of course, this data is demo. Maybe hundreds of lines will be entered, so I want to use repeaters. Actually I can print without sorting. But the important thing for me is to print in order.
Thank you in advance for your help.
If you can’t see the screenshots, the links are:
https://prnt.sc/vylsf6 (json)
https://prnt.sc/vylui6 (admin)
https://prnt.sc/vyls9o (output)
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.