# How to sort an array?

**URL:** <https://forums.unrealengine.com/t/how-to-sort-an-array/464874>\
**Category:** Editor Scripting\
**Tags:** arrays, sorting, unreal-engine, Array, question\
**Created:** [May 8, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/how-to-sort-an-array/464874 "2020-05-08T19:48:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuck\_compiling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stuck\_compiling](https://forums.unrealengine.com/u/stuck_compiling)\
**Post date:** [May 8, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/how-to-sort-an-array/464874/1 "2020-05-08T19:48:02Z")

</div>

I have some integers in an array and I need to sort them by value, but I don’t think making a botched unflexible multiplexer is a good solution, especially as I might need to replace integers with structs. What is the correct, or at least a reasonable way to do this in Blueprints?

---

<div class="post-metadata">

**Author:** ![BamaGame](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BamaGame](https://forums.unrealengine.com/u/BamaGame)\
**Post date:** [May 8, 2020, 7:57pm UTC](https://forums.unrealengine.com/t/how-to-sort-an-array/464874/2 "2020-05-08T19:57:46Z")

</div>

I think it can help you

 ![301469-17.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/f/18f2eb2d12258a8eab1e108b0b8814c3e8c7c075.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 8, 2020, 8:07pm UTC](https://forums.unrealengine.com/t/how-to-sort-an-array/464874/3 "2020-05-08T20:07:37Z")

</div>

Or just get this:

> **[LE Extended Standard Library in - UE Marketplace](https://www.unrealengine.com/marketplace/en-US/item/f6637ea9663447e4b6a0578216992e70)**
>
> This plugin provides you with blueprints that add general functionality and improvements.

it’s free, and does lots of other things:

![301480-sortarray.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/c/54c7e9c92ed48776567a6b86b99cb969bd053dc3.jpeg)

---

<div class="post-metadata">

**Author:** ![stuck\_compiling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stuck\_compiling](https://forums.unrealengine.com/u/stuck_compiling)\
**Post date:** [May 23, 2020, 10:11am UTC](https://forums.unrealengine.com/t/how-to-sort-an-array/464874/4 "2020-05-23T10:11:03Z")

</div>

Thank you! I thought I understood how this worked and tried to adapt it to my needs, but I don’t think I can use the loop array indexes as as is. You seem to be using the integer values as array slot indexes, could you explain this a little bit?

 ![302565-example.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/6/79626e2e9507d19f9fa9c5e386269bd2de3a78d8.png)
