# Filtering Data Issue

**URL:** <https://community.thunkable.com/t/filtering-data-issue/1251224>\
**Category:** Questions about Thunkable X\
**Created:** [April 28, 2021, 7:28pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224 "2021-04-28T19:28:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 7:28pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/1 "2021-04-28T19:28:52Z")

</div>

I’m working on a sample app to show filtered data from a Google sheet in a Data Viewer List, specifically to show either all Foreign Language Oscar nominees, or only those in Spanish.

My strategy is to bind a local Thunkable sheet to the Data Viewer List, and then programmatically place either all rows of the Google sheet into it, or selected ones.

The app works, sometimes. But other times it is slow and the data doesn’t appear either at all or just partially. This is true whether it is in web preview or on my phone.

The code is here:  
[https://x.thunkable.com/projectPage/6088a412ef085d00124746f9](https://x.thunkable.com/projectPage/6088a412ef085d00124746f9)

I’m very interested in ideas for fixing this intermittent problem, and also discussion on whether this is the best strategy to show filtered data.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [April 28, 2021, 8:04pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/2 "2021-04-28T20:04:03Z")

</div>

I suspect this is an asynchronous call problem. You’re trusting that app variable idList is actually populated before you call viewAll.

You’re also assuming that the loop is going to finish before it runs a second time. You’ve got asynchronous calls in there, so that’s not guaranteed, so your ‘film’ variable may not be the value you’re expecting.

If you add a wait of a second (or even a 10th of a second) in that loop, does the problem disappear?

---

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 8:24pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/3 "2021-04-28T20:24:25Z")

</div>

Thank you @catsarisky for the ideas. I wasn’t thinking of the asynchronous nature of some blocks. I did try the “wait” and still having issues, but I’ll play around some more

If you have time and are interested, I have a couple of questions:

1. when you call a function that doesn’t have a “do”, e.g., “list of values in a column”, can you assume it is synchronous, i.e., it will complete before the next row is executed? That was my understanding but not sure.

2. Is the “temporary” sheet to hold filtered data so you can map it to a Data Viewer List the best way to show filtered data?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 28, 2021, 9:41pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/4 "2021-04-28T21:41:04Z")

</div>

Try this example  
[https://x.thunkable.com/projectPage/600c35d2f153060012143dc8](https://x.thunkable.com/projectPage/600c35d2f153060012143dc8)

In the example is based on two local tables but I tested it with the main table from Airtable and the one bound to the DVL is local.

To answer you questions:

> [@David\_Wolber](#):
>
> - when you call a function that doesn’t have a “do”, e.g., “list of values in a column”, can you assume it is synchronous, i.e., it will complete before the next row is executed? That was my understanding but not sure.

Although it seems sequential but it is actually asynch in nature but from my tests it takes nearly the time of retrieving a single record. Due to this short period of time it acts as close as possible to a sequential block.

> [@David\_Wolber](#):
>
> Is the “temporary” sheet to hold filtered data so you can map it to a Data Viewer List the best way to show filtered data?

If you chose a DVL then you have to connect it to a table and currently there is no filter function in Thunkable so you are left with this choice.

I used cloning to get rid of committing to the local table and it works well but unfortunately the DnD UI does not have the **clone** nor the **copy** block and therefore you will be restricted to the old UI.

---

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 10:12pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/5 "2021-04-28T22:12:55Z")

</div>

Thanks @muneer.

- As you’ve had success with airtable/local and local/local, perhaps it is google sheets that is causing the issue (maybe only handles so many hits, or just times out). I’ll try my sample with airtable/local

- asynch/synch: seems weird that you cannot count on sequentiality when you make a call to a function without a “do”, but I think you’re right. Thunk team, is this correct? Is the ultimate goal to rectify this?

- can you explain your use of cloning to avoid committing to local table? I don’t know what you mean and don’t see in your sample

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 28, 2021, 10:17pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/6 "2021-04-28T22:17:34Z")

</div>

I made a sample project showing how to make use of **cloning** to imitate the DVL and populate it directly from a list instead of a table.

See this  
[https://x.thunkable.com/projectPage/60815826ac47a500114175a7](https://x.thunkable.com/projectPage/60815826ac47a500114175a7)

**[Note]**  
It is worth mentioning that cloning also suffers from synchronicity hence the wait block with a splice of time.

---

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 10:23pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/7 "2021-04-28T22:23:06Z")

</div>

Thanks so much, I wasn’t aware you could dynamically create components like that.

I guess the ideal would be for Thunkable to add a method of mapping Data Viewer List to a list of objects (though I realize object properties are dynamic and spreadsheet columns aren’t really)

---

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 10:25pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/8 "2021-04-28T22:25:24Z")

</div>

Interesting that even on a function, clone, with a “do”, you still had to put the wait. It seems like you should be guaranteed sequentiality in the “do”, as well as for call blocks that don’t have a “do”

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 28, 2021, 10:27pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/9 "2021-04-28T22:27:47Z")

</div>

Just try removing this wait block and the process will fail.

I understand your point but practical examples proved different from the what anyone would normally assume.

---

<div class="post-metadata">

**Author:** ![David\_Wolber](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/david_wolber/32/117458_2.png) [@David\_Wolber](https://community.thunkable.com/u/David_Wolber)\
**Post date:** [April 28, 2021, 11:34pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/10 "2021-04-28T23:34:46Z")

</div>

Agreed. My goal is two-fold: figuring out how to use the existing system and figuring out how it should/could work. Your example is great.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:22pm UTC](https://community.thunkable.com/t/filtering-data-issue/1251224/11 "2024-11-08T13:22:50Z")

</div>


