# How to scan rows in a dataviewer list

**URL:** https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716
**Category:** Questions about Thunkable X
**Tags:** data-viewer
**Created:** [July 26, 2021, 10:26am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716 "2021-07-26T10:26:52Z")
**Posts on this page:** 12
**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: [July 26, 2021, 10:26am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/1 "2021-07-26T10:26:52Z")

</div>

I have a dataviewer list.  
Clicking on an item, I modify some values of a label in that Item.  
Now I would like to scan every items to search if the label has a certain value and do something if so.  
Unfortunatelly It’s not clear to me how to do it.  
Are every single element of a dataviewer list rows?  
This is what I’m doing but i get a single iteration for a 3 items list.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/5/b5f06ae48e73825c4a5140a864ad8379683c0e64.png)  
And this is the project.  
[https://x.thunkable.com/copy/53143abfe36ba69fe05c12944cfd0429](https://x.thunkable.com/copy/53143abfe36ba69fe05c12944cfd0429)  
thank you!

---

<div class="post-metadata">

### Author: ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)
#### Post date: [July 26, 2021, 10:43am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/2 "2021-07-26T10:43:51Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/a/bac4cdd6f86a0163a6754ebf9980688d47137b0e.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: [July 26, 2021, 11:30am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/3 "2021-07-26T11:30:56Z")

</div>

The problem is that the value I’m looking for is not in the source table.  
Is a Value I apply to the item basing on a user interaction.

---

<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: [July 26, 2021, 5:04pm UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/4 "2021-07-26T17:04:25Z")

</div>

Are you saying that you’re changing the displayed value in the dataviewer list without changing the attached database? You probably shouldn’t do that. @codeswept’s blocks should work if the data is in the source table.

Can you show the blocks you’re using to apply the value to the item based on user interaction?

---

<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: [July 26, 2021, 6:29pm UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/5 "2021-07-26T18:29:45Z")

</div>

As @tatiang said you should not change something in the DVL directly and the best practice is to change the database values.

However, this code is changing the image of the DVL outside of the database and it works with me.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/d/4dce1c63958cd29aaa3e10f28129a14ea5405449.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: [July 27, 2021, 7:13am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/6 "2021-07-27T07:13:09Z")

</div>

> [@](#):
>
> Are you saying that you’re changing the displayed value in the dataviewer list without changing the attached database? You probably shouldn’t do that. @codeswept’s blocks should work if the data is in the source table.
> 
> Can you show the blocks you’re using to apply the value to the item based on user interaction?

Recap:  
I have a list of rows, In every row there is a Label taking it’s text from a DB and a flag to select some specific row, then I should take the selected rows to something.  
The flag is not taken from DB but is applyied by user when clicking.  
No sense to have it stored in the DB. I can do it, but it has no sense.  
Clicking the button I would like to change the button background color and the text of the button.  
In my past version I cloned row to have a list and all works, but it was slow to crate and fill rows from DB so I’m looking for a faster version and I’m trying with a custom dataviewer list.  
BUT  
With Dataviewer list It seems not possible to change button properties  
This code Cause NO EFFECT

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/a/6a1971151ccf1ac600aea4dc3fb3c83fd3028dc4.png)  
The same thing applied on a label works.  
Here is a project with both label and button  
[https://x.thunkable.com/copy/40bad032babd530db421e02fd5c2067a](https://x.thunkable.com/copy/40bad032babd530db421e02fd5c2067a)  
So I decided to use a label instead of a button.  
All this to explain why I change a value without touching the DB.

I would like to retrieve the flagged rows directly from the dataviewer but As you said, it seems that I can’t do it if I don’t store the flag value in the DB.  
Is this the only way? ☹

---

<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: [July 27, 2021, 9:00am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/7 "2021-07-27T09:00:43Z")

</div>

When I preview your project, I can click and change the data viewer 1 at the top (a, b, c) and see the color/text changes:

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

But not the data viewer 2 at the bottom (label, label, label). That one has errors:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/5/4579086bc3d20e0b1e22d9421c35735746cb0ca4.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: [July 27, 2021, 9:16am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/8 "2021-07-27T09:16:37Z")

</div>

Just reselect the dataviewer element, maybe it’s due to a change of the position of the button si the Dataviewer seems different and it has to be relinked

---

<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: [July 27, 2021, 9:26am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/9 "2021-07-27T09:26:07Z")

</div>

I tried that and couldn’t get Data\_Viewer\_List2’s color/text to change. I’m not sure why.

---

<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: [July 27, 2021, 9:47am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/10 "2021-07-27T09:47:59Z")

</div>

The `Button` can **not** be part of the Data Viewer components. If you add it to the DVL it will not trigger the `item click` event when you click on it. This is why you do not see it functioning.

---

<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: [July 27, 2021, 10:09am UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/11 "2021-07-27T10:09:34Z")

</div>

Similar problem even using a switch. It doesn’t trigger the item click event and it switch value of ALL switches at a time.  
However, maybe it’s better to discuss it on teh specific topic

> [@Boolean object for Dataviewer list](https://community.thunkable.com/t/boolean-object-for-dataviewer-list/1415106/6):
>
> Too early frowning I’ve tried with a switch, but when i click the switch every switch of the list change values!! Take a look here: [Thunkable](https://x.thunkable.com/copy/8bbf979843c26b41edf4ffa8774e557f)\< Moreover it seems not to trigger the item click even if I click on the label

For now, it seems there is no way to scan items of a list out of a Data Source scanning and using a boolean object so I MUST insert the “boolean” value in the data source table and display it as a label.

---

<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:17pm UTC](https://community.thunkable.com/t/how-to-scan-rows-in-a-dataviewer-list/1414716/12 "2024-11-08T13:17:47Z")

</div>


