# CASE: Use "persistent\_id" to sort the "people" drop

**URL:** <https://community.silverfin.com/t/case-use-persistent-id-to-sort-the-people-drop/2131>\
**Category:** Cases\
**Tags:** addnewinputs, people, sort, id, persistent\_id\
**Created:** [July 27, 2021, 3:56pm UTC](https://community.silverfin.com/t/case-use-persistent-id-to-sort-the-people-drop/2131 "2021-07-27T15:56:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [July 27, 2021, 3:56pm UTC](https://community.silverfin.com/t/case-use-persistent-id-to-sort-the-people-drop/2131/1 "2021-07-27T15:56:50Z")

</div>

Hi there 🖐,

You might have noticed that the `period.people` drop is automatically sorted by name in alphabetical order.

For example:

```auto
{% fori person in period.people %}
  {% input person.name %}
{% endfori %}

```

![ezgif.com-gif-maker](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/9/9077a56fb10dc78df9c7f214c764861a1ec5b248.gif)

This is quite handy in most scenarios. However, you sometimes want to sort the names in the order they were entered. We can do this by sorting the collection using `persistent_id` :

```auto
{% addnewinputs %}
  {% assign people = period.people | sort:'persistent_id' %}
{% endaddnewinputs %}

{% fori person in people %}
  {% input person.name %} {{ person.persistent_id }}
{% endfori %}

```

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/9/983b24b7295968e5f89a7fbf19fdeb0acd1acb17.png)

As you can see in the above image, I printed the persistent\_id to show how this unique reference is assigned to each name in the drop following the natural enumeration order.

Now, because `1932342` is greater than `1932341`, Charlie appears after Zoe.  
  
  
ℹ **NOTE** : You can achieve similar results by using `id` instead of `persistent_id`. However, bear in mind that `id` changes from period to period (i.e. the id number will be different in 2021 than in 2020) so it’s always better to use persistent\_id to avoid issues when copying data across different periods.

For example:

**2020**

![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/c/c0d46fb0fcfed640921d3c6fac3f8ddb379fe575.png)

**2021**  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/8/8229454f1b77d0c1f0af5350075e70292581c11a.png)

Hope this was useful!

Best,  
Borja
