# Unexpected result with Custom Data Viewer

**URL:** <https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795>\
**Category:** Questions about Thunkable X\
**Tags:** data-viewer\
**Created:** [October 2, 2020, 2:49pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795 "2020-10-02T14:49:07Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [October 2, 2020, 2:49pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/1 "2020-10-02T14:49:07Z")

</div>

When I preview this code on Thunkable Live or as a web app, it creates a new row in the local db but doesn’t change the text and background colors unless it’s the last row of the db.

 ![Screen Shot 2020-10-02 at 7.43.29 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/4978b5ea5c4184a51bc971dfbee80bb7dbe8863c.png)

Here’s the database contents:

 ![Screen Shot 2020-10-02 at 7.49.41 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/93116d7ca83cc8e151ac7cf2d9651a484f474675.png)

So if I preview it once, I get this:

 ![Screen Shot 2020-10-02 at 7.48.02 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c0ecafb6aa046362db69beff7595c0a112f26af2.png)

But if I then preview it again, I get this:

 ![Screen Shot 2020-10-02 at 7.48.12 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/f/df8715c85def27e23330e26a34a684bdfc16fe17.png)

**Why doesn’t the second to last list item also have the correct color scheme?**

And… if I use a variable for the row id, it then adds TWO rows every time I preview it instead of one.

 ![Screen Shot 2020-10-02 at 8.00.21 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/af03d7f977db7eacbe489a14aa82e1fb95fed5fc.png)

Here’s a link to that version of the project:

[https://x.thunkable.com/copy/4ea2b55b63fa4dadb7dbe253c4a77143](https://x.thunkable.com/copy/4ea2b55b63fa4dadb7dbe253c4a77143)

---

<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:** [October 2, 2020, 3:12pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/2 "2020-10-02T15:12:43Z")

</div>

@Steven is this bug still relevant to what’s happening to me?

> [@From today rowID not work in "Create a local data source"](http://community.thunkable.com/t/from-today-rowid-not-work-in-create-a-local-data-source/775574):
>
> From today rowID not work in “Create a local data source” Returns an undefined value [rowID]

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://community.thunkable.com/u/Steven)\
**Post date:** [October 6, 2020, 9:46pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/3 "2020-10-06T21:46:30Z")

</div>

For your first question, your blocks are only setting the background color and text color for the newly created row because that is the id being returned. If you want it to be applied to all of the rows you have two options:

1. You would need to use the `list of values` block to get all the ids and the relevant values to set the colors. Then use the setter and getter blocks along with the ids to set the background color/text color for every row.
2. If you wanted to use Google sheets or Airtable you could make the colors a column and have a formula determine what color the background and text should be. You could then bind those columns to the values for background color and text color.

Does that make sense?

As for your second question, that isn’t something I’ve seen before. I’ll take a look and see if I can determine what is going on. I do not think that bug is still relevant though it is possible. I’ll let you know once I have a better idea.

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://community.thunkable.com/u/Steven)\
**Post date:** [October 7, 2020, 8:27pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/4 "2020-10-07T20:27:38Z")

</div>

I looked into the second issue you mentioned of two rows being created. I don’t think this is an issue with the `create row` block itself but rather a result of using the `Opens` block for the screen. It seems the screen is `opening` twice on the initial load for some reason. So this is an issue, but separate from the data source block. Can you confirm if you were seeing this issue on web only or was it also happening on your Thunkable Live app?

---

<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:** [October 7, 2020, 10:37pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/5 "2020-10-07T22:37:02Z")

</div>

> [@Steven](#):
>
> For your first question, your blocks are only setting the background color and text color for the newly created row because that is the id being returned. If you want it to be applied to all of the rows you have two options:

I get it now. I was expecting the background color to “stick” but since I’m not saving it anywhere, the custom data viewer layout is just using the color that was entered as a layout.

> [@Steven](#):
>
> Can you confirm if you were seeing this issue on web only or was it also happening on your Thunkable Live app?

I think it was happening on Thunkable Live. Definitely as a web app. I’m now looking into ways to update the color for all list items. So I’ve moved on a bit but I can still help troubleshoot this if needed. I think part of it was my misunderstanding about the background color not changing.

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://community.thunkable.com/u/Steven)\
**Post date:** [October 7, 2020, 10:42pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/6 "2020-10-07T22:42:37Z")

</div>

No need to help troubleshooting but thanks for offering! Let me know if you have any other questions I can help with.

I guess it isn’t entirely clear that changing the props to the dv layout components are temporary changes. So that is something we should work on clarifying.

---

<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, 12:23pm UTC](https://community.thunkable.com/t/unexpected-result-with-custom-data-viewer/868795/7 "2024-11-08T12:23:33Z")

</div>


