# Change datasource settings dynamically

**URL:** <https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742>\
**Category:** Questions about Thunkable X\
**Tags:** data-source, data-viewer\
**Created:** [November 24, 2022, 2:46pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742 "2022-11-24T14:46:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 24, 2022, 2:46pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/1 "2022-11-24T14:46:55Z")

</div>

Hi,  
I have a google sheets document I use to populate a dataviewer list.  
When I select an element from the dataviewer list I get into a detail page of the X item.  
From there I would like to access another page with a new dataviewer list that use a specific datasouce, basing on the previous selection.  
Is it possible to do something like this?

---

<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:** [November 24, 2022, 5:10pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/2 "2022-11-24T17:10:22Z")

</div>

No, it’s not possible but I think you can select different sheets (tabs) within a single Google Sheet:

> <https://github.com/thunkable/thunkable-issues/issues/1048>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> Not exactly.…..
> 
> \*\*Describe the solution you'd like\*\*
> I would like to be able to sync a Data Viewer List (DVL) to a specific named tab/sheet in a Google Sheet. This is for the purpose of sorting data in the Sheet as described in \[this forum post\](https://community.thunkable.com/t/can-you-only-reference-a-single-sheet-in-google-sheets/1588629).
> 
> \*\*Describe alternatives you've considered\*\*
> It's messy but possible to store sorted values below/above synced values in a single tab/sheet but I'd really rather not do this because it introduces all sorts of other issues when adding new rows or checking the length of a row, etc.
> 
> \*\*Which platform are you asking for?\*\*
> Thunkable X
> 
> \*\*Additional context\*\*

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 24, 2022, 5:29pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/3 "2022-11-24T17:29:02Z")

</div>

But it should be an already confugured sheet.  
I can’t change sheet of a datasource dynamically,right?  
I mean, there is no “sheet” property block in datasource or “set datasource” method in dataviewer list

---

<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:** [November 24, 2022, 9:20pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/4 "2022-11-24T21:20:07Z")

</div>

The “Table1” drop-down menu lets you choose a sheet if I’m not mistaken:

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

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 24, 2022, 10:06pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/5 "2022-11-24T22:06:20Z")

</div>

Yes I found that block but it doesn’t allow to populate a whole dataviewer list or to select a sheet.  
If I have 20 different sheet I should develop a 20 if statement structure.  
It could be nice if I could insert a string in the sheet field instead of a drop-down selection or dynamically select an already loaded data-source to populate the list

---

<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:** [November 24, 2022, 10:28pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/6 "2022-11-24T22:28:44Z")

</div>

I agree that there should be a way to select a data source dynamically.

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 25, 2022, 2:36pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/7 "2022-11-25T14:36:33Z")

</div>

It’s even not clear for me how to populate a dataviewer list using a for loop.  
All blocks from datasources ask for a row id but I can only give a numer of the row using a for loop, not a row ID, else I should create a copy of teh datasource locally, getting column by column all the values…

---

<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:** [November 25, 2022, 5:18pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/8 "2022-11-25T17:18:34Z")

</div>

In the `list of values` Data Source block you can change the drop-down menu to ID which will provide a list of row IDs for the data source.

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 28, 2022, 10:09am UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/9 "2022-11-28T10:09:46Z")

</div>

Ok, I can get the rowID from datasource table.  
Now, how to get rowID for dataviewer list?  
It asks for it to change value in a field, but maybe it supposes to get it from a click event or from a datasource list of value I don’t have trying to populate the list dynamically.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/5/051ae563fecb8d4a0d65e5951dafd90c62bd100e.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:** [November 28, 2022, 3:50pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/10 "2022-11-28T15:50:35Z")

</div>

Yes, you need to get it from a click event. Although, it’s the same as the ID field in the `list of values` block for the data source so you can also get it from there but you won’t know which row was clicked without the green block from the DVL click event.

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 28, 2022, 3:54pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/11 "2022-11-28T15:54:13Z")

</div>

So it’s not usable to populate the DVL dynamically ☹

---

<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:** [November 28, 2022, 5:06pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/12 "2022-11-28T17:06:25Z")

</div>

It is but I’m not sure what you mean exactly. Can you provide an example?

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 28, 2022, 5:36pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/13 "2022-11-28T17:36:16Z")

</div>

I have a 40 rows sheet.  
For every row there is a user.  
Each user enters his related events on another specific spreadsheet or on another sheet of the same spreadsheet.  
Depending on the case, I should have 41 Spreadsheets or or One spredsheets with 41 sheets.  
In both case, I have a dataviewer list to select the user, and then in the detail page of that user, another dataviewer list showing related events.  
So I need to read the events sheet row by row (at the moment there’s no way to determine which sheet to open dynamically so I will start with a single user sheet) **but I can’t populate the DVL row by row**.  
I suppose to do so, I should read the sheet and place the result data in a table that act as data source for the DVL.

---

<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:** [November 28, 2022, 9:18pm UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/14 "2022-11-28T21:18:59Z")

</div>

Personally, I would use Firebase for something like this. Having 41 spreadsheets or 41 sheets sounds like a nightmare.

You can populate a DVL however you want if you use clones instead of the DVL component. It’s a lot of work and hard to debug but it’s what I’ve ended up doing.

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Geppo\_Catta](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Giuseppe\_Geppo\_Catta](https://community.thunkable.com/u/Giuseppe_Geppo_Catta)\
**Post date:** [November 29, 2022, 8:16am UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/15 "2022-11-29T08:16:33Z")

</div>

Yes, I know 40 spreadsheets is not the best solution…  
I developed the same application using AIrTable, and I can bypass these problems using queries.  
But recently I’ve seen a brand new tutorial about Thunkable with spreedsheet and DVL And it seems to me a nice and faster solution without using DB, but first of all, simple to allow user to insert their events easily, without learning any new software, simply add a row in a spreadsheet shared via google drive.  
I took a look even at google sheet API, but it’s too tricky even only to get a working developer account 🙂

---

<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:** [February 27, 2023, 8:16am UTC](https://community.thunkable.com/t/change-datasource-settings-dynamically/2147742/16 "2023-02-27T08:16:50Z")

</div>

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