# Best way to manage API data

**URL:** <https://community.thunkable.com/t/best-way-to-manage-api-data/479060>\
**Category:** Questions about Thunkable X\
**Tags:** webapi, local-variables\
**Created:** [February 22, 2020, 8:18pm UTC](https://community.thunkable.com/t/best-way-to-manage-api-data/479060 "2020-02-22T20:18:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdawc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hdawc/32/119068_2.png) [@hdawc](https://community.thunkable.com/u/hdawc)\
**Post date:** [February 22, 2020, 8:18pm UTC](https://community.thunkable.com/t/best-way-to-manage-api-data/479060/1 "2020-02-22T20:18:28Z")

</div>

Hello.

I’m pretty much new to APIs, especially regarding Thunk.

I’d like to ask about the best way to store (JSON) data.

I have a series of lists. At the moment an API call is made when a user clicks an item on the list. Then that new JSON is filtered and replaces the existing list. Constantly calling the API seems like a bad way to do things and I would like some advice on doing one big API call on app start.

What is the best way to store a bunch of API calls, or is there a way to filter the JSON **IN** Thunkable as at the moment I can get Properties and Objects, but not filter them before I extract the objects to a list, nor after.

I’ve tried to do a big API call at the start and store each API response as a variable. But I then can’t call the data later and insert it into a list as is shown below.

For example, when I use this:

 ![filter-data](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/f/2fd2f96a50412e8c7b754cfec0e3c32c897118fb.png)  
which does return a correct list (ignore the “`do something`”), I’m not sure how to filter it at the point while it is still JSON, or after it becomes a list in storedEventsList. I would guess that I would do it after.

**At the moment I change the API URL and do a new API call for each time the list is changed. Which obviously isn’t ideal…**

Thanks 🙂,

Eric.

---

<div class="post-metadata">

**Author:** ![hdawc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hdawc/32/119068_2.png) [@hdawc](https://community.thunkable.com/u/hdawc)\
**Post date:** [February 22, 2020, 8:44pm UTC](https://community.thunkable.com/t/best-way-to-manage-api-data/479060/2 "2020-02-22T20:44:30Z")

</div>

I’ve actually found my own answer, which is always nice 🙂

 ![filter-data-answer](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/5/759b19a3d223e3d2e9d79ceb89ee264cbf1e5100.png)

I started by using a TEST inside the list (after insert last as), but this would leave me with empty list items because they would still be created.

By using a IF _before_ the list, I can still filter the JSON, but then only add list items IF they meet the aforementioned condition, which in this case is a specific stage. But could be used to match any property.

I can then store that data in a var and populate the single list view when needed, without having to do lots of API calls 😃 👍

---

<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, 11:40am UTC](https://community.thunkable.com/t/best-way-to-manage-api-data/479060/3 "2024-11-08T11:40:55Z")

</div>


