# For each item j in list, how to get \[k in list\]?

**URL:** <https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753>\
**Category:** Questions about Thunkable X\
**Tags:** help\
**Created:** [January 20, 2025, 1:53am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753 "2025-01-20T01:53:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asura2005766339b89](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@asura2005766339b89](https://community.thunkable.com/u/asura2005766339b89)\
**Post date:** [January 20, 2025, 1:53am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753/1 "2025-01-20T01:53:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/8/18f766bb3dc906ea8503279272eb280ecd1c3aca.png)  
Is there a way to get another variable other than j?  
I managed to do it in another project but not sure how to do it here.

I’m trying to iterate through a nested list like in the following pic

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/d/dd72d13cceacbec2992587432f56904000293e86.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![asura2005766339b89](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@asura2005766339b89](https://community.thunkable.com/u/asura2005766339b89)\
**Post date:** [January 20, 2025, 2:23am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753/2 "2025-01-20T02:23:31Z")

</div>

I’ve found this thread after some searching, but it doesn’t offer a full solution? Other than the weird creating a function way.

> [@Tip: User declared variables will NOT work in “for each” loops](https://community.thunkable.com/t/tip-user-declared-variables-will-not-work-in-for-each-loops/1865107/8):
>
> I agree. This is not technically a bug. It’s the way Thunkable is intended to be used… not necessarily the best way it could be configured but it’s intentional, I believe. The loop block has its own internal variables that you need to use.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 20, 2025, 3:06am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753/3 "2025-01-20T03:06:41Z")

</div>

Click on the name of the loop variable ( j ) within the block and choose rename variable.

---

<div class="post-metadata">

**Author:** ![asura2005766339b89](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@asura2005766339b89](https://community.thunkable.com/u/asura2005766339b89)\
**Post date:** [January 20, 2025, 3:50am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753/4 "2025-01-20T03:50:56Z")

</div>

Is there a way to have multiple variables?  
When using rename variable it turns all the ‘j’ into ‘k’ for example. I’m trying to get j, k, etc., as in multiple variables

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [April 20, 2025, 3:51am UTC](https://community.thunkable.com/t/for-each-item-j-in-list-how-to-get-k-in-list/3492753/5 "2025-04-20T03:51:39Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
