# \[Solved\] Dynamically Reference of DatasourceTables

**URL:** <https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133>\
**Category:** Questions about Thunkable X\
**Created:** [May 16, 2022, 7:05pm UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133 "2022-05-16T19:05:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [May 16, 2022, 7:05pm UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/1 "2022-05-16T19:05:00Z")

</div>

Hi Thunkers!

I’m looking a way to dynamically choose the name of the Datasource’s table when creating / getting / deleting rows locally, as also create new tables during the app session, but the current blocks doesn’t allow to do it, only use the pre-defined tables, “hard coding” the create / get / delete actions.

Please let me know if you know any hack or another approach to make it work (storing data buckets for offline apps, maybe save/read locally a JSON file)?.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 16, 2022, 7:52pm UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/2 "2022-05-16T19:52:02Z")

</div>

You can store data in variables as Json trees. You could do things that way perhaps? Dynamic branches within 1 variable.

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [May 16, 2022, 7:56pm UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/3 "2022-05-16T19:56:55Z")

</div>

humm… I hadn’t thought of that…but it looks like a solution!

But how to initialize stored variables dynamically? I mean, I will need to do CRUD operations with stored variables to keep different data locally (create/read/update/delete these variables) and the “initialize” block is not customizable, only the “set” block.

But if I choose to use a single Variable the size o Json will the increase, so my first idea was to create dinamically different variables to store a limited number of buckets.

Anyway I’m going to do some tests to check how to manipulate Json, and for that, I’ll have to develop functions for reading and writing, but I believe it’s quite easy to do.

the only downside may be that for larger volumes of data there may be considerable delays in writing / retrieving the whole data each time some Json object is updated.

**[UPDATE]**

I can create a Stored Variable as a LIST… So the problem can be solved! I can save a different JSON for each list Item. Of course I’ll have some overhead in the reading / saving process.

---

<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:** [May 16, 2022, 9:27pm UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/4 "2022-05-16T21:27:36Z")

</div>

Yes, I was going to recommend a list in a stored variable.

---

<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:** [May 17, 2022, 3:00am UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/5 "2022-05-17T03:00:11Z")

</div>

If you start to do this then consider saving your data in `Firebase` instead of `stored variables` specially if you wan the data to be user specific because you can save the data under the `Logged In user ID`.

It is more of a use case dependent.

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [May 17, 2022, 4:41am UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/6 "2022-05-17T04:41:42Z")

</div>

The point here is that is an offline APP, with very limited access to Firebase to use on poor internet signal regions, so I will sync with Firebase only when online. Meanwhile I need to save the data collected in the app to save later.

---

<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:** [August 15, 2022, 4:42am UTC](https://community.thunkable.com/t/solved-dynamically-reference-of-datasourcetables/1879133/7 "2022-08-15T04:42:02Z")

</div>

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