# Filtering data with two lists

**URL:** <https://community.thunkable.com/t/filtering-data-with-two-lists/2884589>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help\
**Created:** [March 10, 2024, 7:38am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589 "2024-03-10T07:38:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahn20271jfr](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jahn20271jfr](https://community.thunkable.com/u/jahn20271jfr)\
**Post date:** [March 10, 2024, 7:38am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/1 "2024-03-10T07:38:31Z")

</div>

Hello, I am currently working on a data filtering application. I connected a google spreadsheet with two sheets: one for the names of the clubs and one for the list of the students. If the user clicks the club, I want the list to display the students who are in the selected club. But now the list is showing nothing and the screen is even crashing. The 1 next to app variable club is going to be replaced with j. The current code is:

 ![Screenshot 2024-03-10 at 4.37.45 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/703976df52f8f50e95c3ea584f690bec04954ab2.png)

---

<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:** [March 10, 2024, 7:52am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/2 "2024-03-10T07:52:44Z")

</div>

Hi and welcome to Thunkable!

What does your data source look like? And what does `app variable club` store?

Also, the `j` variable in your loop holds the student’s name. You don’t need to use the `in list` variable to get the student name again. Plus, `j` is not a numeric value. It’s a text string so you can’t get #j of the list.

---

<div class="post-metadata">

**Author:** ![jahn20271jfr](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jahn20271jfr](https://community.thunkable.com/u/jahn20271jfr)\
**Post date:** [March 10, 2024, 8:27am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/3 "2024-03-10T08:27:40Z")

</div>

Thank you for replying. I will share you the link of my application. It has other functions, such as the tutorial or password creation, but you can just ignore those. [https://x.thunkable.com/copy/b6c98af4100fcca7c94e9ececf439d26](https://x.thunkable.com/copy/b6c98af4100fcca7c94e9ececf439d26)

---

<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:** [March 10, 2024, 8:51am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/4 "2024-03-10T08:51:04Z")

</div>

`app variable club` contains the name of the club that was clicked. But then in the next screen, you use that variable as a list and try to get an item # from it. That isn’t going to work.

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

---

<div class="post-metadata">

**Author:** ![jahn20271jfr](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jahn20271jfr](https://community.thunkable.com/u/jahn20271jfr)\
**Post date:** [March 10, 2024, 8:53am UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/5 "2024-03-10T08:53:50Z")

</div>

![Screenshot 2024-03-10 at 5.51.45 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/afc3c3539361e1b7273971ab63389ae3fe7d6c71.png)  
do you think this is going to work? I changed the club that the user clicks as selectedclub and named the entire list of clubs as club. I am trying to get the index number of the club that is equal to the selected club, and put the student’s name with the same index to the list.

---

<div class="post-metadata">

**Author:** ![jahn20271jfr](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jahn20271jfr](https://community.thunkable.com/u/jahn20271jfr)\
**Post date:** [March 10, 2024, 3:06pm UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/6 "2024-03-10T15:06:39Z")

</div>

Oh wait I did it!!! Thank you for your advice.

---

<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:** [June 8, 2024, 3:07pm UTC](https://community.thunkable.com/t/filtering-data-with-two-lists/2884589/7 "2024-06-08T15:07:08Z")

</div>

Closed on June 8, 2024, 3:07pm UTC

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