# Sort Array plugin

**URL:** <https://community.glideapps.com/t/sort-array-plugin/57299>\
**Category:** Ask for Help\
**Created:** [January 31, 2023, 9:42am UTC](https://community.glideapps.com/t/sort-array-plugin/57299 "2023-01-31T09:42:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 9:42am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/1 "2023-01-31T09:42:04Z")

</div>

Hello Everyone,  
Sort Array Plugin is not working properly, Can anyone help me with this.Please refer the screen shot

 ![credits](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/6/f6238cacfefed2d7a8f641d252586732fff5b93a.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 31, 2023, 9:45am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/3 "2023-01-31T09:45:42Z")

</div>

How are you creating the array?

I know that the Sort Array behaves differently depending on how the array is created.

If it’s a result of a join + split, then the resultant sort is lexical.  
If it’s a direct lookup on a number column, then the sort is numerical.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 9:47am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/4 "2023-01-31T09:47:00Z")

</div>

It’s a lookup

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 31, 2023, 9:48am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/5 "2023-01-31T09:48:10Z")

</div>

A lookup on what?

Can you show me the configuration of that column please?

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 9:51am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/6 "2023-01-31T09:51:16Z")

</div>

credits column is lookup from other table, on credits column I am using unique elements plugin to get unique elements and sorting these unique elements

 ![config](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b6bbc4516248b80f58c116a8db6bfe81de57bafa.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 31, 2023, 9:58am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/7 "2023-01-31T09:58:10Z")

</div>

Please show me the configuration of the Credits Array column, as well as the data in the table that it references.

My hunch is that somewhere in the chain you have data that is non-numeric.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 10:09am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/8 "2023-01-31T10:09:01Z")

</div>

![Data](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/b/6b9ded7b80e11820a119f7b912576821132b58e7.png)  
 ![Champ](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e5cca42ba8be0699d786694b98839c3a68aa7c23.png)

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 10:13am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/9 "2023-01-31T10:13:20Z")

</div>

![usr](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/f/1f1bf05e69cb2ae9c0369491893f4e8ef59aca42.png)  
from this column I have fetched the total points

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 31, 2023, 10:20am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/10 "2023-01-31T10:20:14Z")

</div>

So the Credits Array column shown in your very first screen shot is a lookup on the Total Credits column shown in your last screen shot, yes?

Please confirm the above. If that’s correct, then I can’t explain the behaviour.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [January 31, 2023, 10:48am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/11 "2023-01-31T10:48:07Z")

</div>

Credits array is lookup of credits column of the same table(data helper) credits column is the lookup total Points column in champion table, that total points column in turn lookup of Total credits column of UserLogin Table

 ![Data](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/b/6b9ded7b80e11820a119f7b912576821132b58e7.png)  
 ![data helper](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/2/d22cf42e2b91ecaea8d6511cffaddf27c1ed4b88.png)  
 ![Champ](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e5cca42ba8be0699d786694b98839c3a68aa7c23.png)  
 ![usr](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/f/1f1bf05e69cb2ae9c0369491893f4e8ef59aca42.png)

these screenshots are sequentially arranged

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [January 31, 2023, 10:48am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/12 "2023-01-31T10:48:33Z")

</div>

Your Relation\_UserLogin and Relation\_Champion relations: in both of these relations are both the source and destination columns numerical values?

You’re navigating through relations and lookups, and somewhere along the way you seem to be bringing in a lexical value. Is it possible that one of your columns is a basic text when you meant to set it as a basic number?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 31, 2023, 1:28pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/13 "2023-01-31T13:28:25Z")

</div>

If you have confirmed to the best of your knowledge that those numeric values have remained numeric as they have passed from column to column, then one of the plugins may still be converting them to text. I would try moving your sort higher up the chain. Maybe Sort BEFORE you get Unique values.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 31, 2023, 1:37pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/14 "2023-01-31T13:37:56Z")

</div>

Yes…I’m pretty sure the unique values converts values to text.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [January 31, 2023, 1:39pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/15 "2023-01-31T13:39:48Z")

</div>

That’s it, Bob.  
I just did a quick test and you’re absolutely right 👍

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [January 31, 2023, 1:41pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/16 "2023-01-31T13:41:18Z")

</div>

I had that same issue when I was building my ranking logic.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [January 31, 2023, 1:52pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/17 "2023-01-31T13:52:14Z")

</div>

That’s correct!

the workaround for @madhu is to change the order of procedure, I mean:

1. Create your array
2. Sort the array
3. Use Unique Element plugin with sorted array

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/3/53e0148f951e89a9962a62aec40aa9f499ff4ce3.jpeg)

Saludos.

---

<div class="post-metadata">

**Author:** ![madhu](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@madhu](https://community.glideapps.com/u/madhu)\
**Post date:** [February 2, 2023, 6:15am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/25 "2023-02-02T06:15:59Z")

</div>

Thank You all for your time and support, it worked.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 2, 2023, 7:00am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/27 "2023-02-02T07:00:56Z")

</div>

@glide do not reply to this topic again.

---

<div class="post-metadata">

**Author:** ![glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/glide/32/53398_2.png) [@glide](https://community.glideapps.com/u/glide)\
**Post date:** [February 2, 2023, 7:00am UTC](https://community.glideapps.com/t/sort-array-plugin/57299/28 "2023-02-02T07:00:59Z")

</div>

_This is an experimental reply from a bot. Please like it if it’s correct._

We apologize for any inconvenience caused. We understand that you may not want to receive replies to this topic, and we will respect your wishes.

---

<div class="post-metadata">

**Author:** ![glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/glide/32/53398_2.png) [@glide](https://community.glideapps.com/u/glide)\
**Post date:** [February 2, 2023, 4:00pm UTC](https://community.glideapps.com/t/sort-array-plugin/57299/29 "2023-02-02T16:00:03Z")

</div>

_This is an experimental reply from a bot. Please like it if it’s correct._

Yes, that is correct. Please reach out to our customer support team at [support@glideapps.com](mailto:support@glideapps.com) and we’ll be happy to help you troubleshoot the issue.

[Next page](https://community.glideapps.com/t/sort-array-plugin/57299.md?page=2)
