# Any way to know the numeric position of a specific entry within a list

**URL:** <https://forum.bubble.io/t/any-way-to-know-the-numeric-position-of-a-specific-entry-within-a-list/56693>\
**Category:** Questions\
**Created:** [May 14, 2019, 12:44am UTC](https://forum.bubble.io/t/any-way-to-know-the-numeric-position-of-a-specific-entry-within-a-list/56693 "2019-05-14T00:44:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sridharan.s](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sridharan.s/32/17881_2.png) [@sridharan.s](https://forum.bubble.io/u/sridharan.s)\
**Post date:** [May 14, 2019, 12:44am UTC](https://forum.bubble.io/t/any-way-to-know-the-numeric-position-of-a-specific-entry-within-a-list/56693/1 "2019-05-14T00:44:53Z")

</div>

I’m trying to find the position of a text entry within custom state that’s set to be a list of text fields. Additionally, I’m running a workflow on this list so I want the position of each entry as I submit it to an API workflow on the list – so something hacky that works for 1 entry isn’t viable here.

Any ideas for how I might approach this?

---

<div class="post-metadata">

**Author:** ![seanhoots](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/seanhoots/32/12224_2.png) [@seanhoots](https://forum.bubble.io/u/seanhoots)\
**Post date:** [May 14, 2019, 1:29am UTC](https://forum.bubble.io/t/any-way-to-know-the-numeric-position-of-a-specific-entry-within-a-list/56693/2 "2019-05-14T01:29:16Z")

</div>

On top of my heard no native bubble solution comes to mind but you can easily do this in javascript using the Array `indexOf()` function.

For example if you have a list as `names = ['John','Mary','Peter', 'Dave','Anne']`,  
then calling `names.indexOf('Dave')` will return `2`.  
Note that javascripts arrays count from 0 so first position is 0, second is 1 and so on.  
If the item is not in the list, it will return -1.  
If the item appears more than one in the list, the first position found will be returned (since bubble lists don’t have duplicates this shouldn’t be an issue for you).

So you can easily use the toolbox plugin and the JavascriptToBubble element to get the value from javascript into bubble.

---

<div class="post-metadata">

**Author:** ![telaholcomb](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/telaholcomb/32/66534_2.png) [@telaholcomb](https://forum.bubble.io/u/telaholcomb)\
**Post date:** [December 12, 2024, 12:53pm UTC](https://forum.bubble.io/t/any-way-to-know-the-numeric-position-of-a-specific-entry-within-a-list/56693/3 "2024-12-12T12:53:20Z")

</div>

Did you ever find a solution for this? I have a similar use case.
