# Making a list-based chat but having a problem

**URL:** https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849
**Category:** Questions about Thunkable X
**Created:** [July 4, 2019, 4:32pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849 "2019-07-04T16:32:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![solidad](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@solidad](https://community.thunkable.com/u/solidad)
#### Post date: [July 4, 2019, 4:32pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/1 "2019-07-04T16:32:15Z")

</div>

![chat_list_experiment](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/7/c71b876efc7dd610dc4c4a27c55dca3e25858af8.png)

The above blocks work but only visually. The data in chat\_input gets saved but keeps getting over-written but visually the list gets updated correctly. I am at a loss.

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [July 4, 2019, 5:40pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/2 "2019-07-04T17:40:40Z")

</div>

What is your expectation on what is supposed to be happening?

Are you expecting the Realtime\_DB1 to contain all of the chat inputs, or only the last one?  
Because right now, this is what it is doing: using the same tag with new data does not add, it replaces.

---

<div class="post-metadata">

### Author: ![solidad](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@solidad](https://community.thunkable.com/u/solidad)
#### Post date: [July 4, 2019, 5:56pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/3 "2019-07-04T17:56:45Z")

</div>

> [@CBVG](#):
>
> Are you expecting the Realtime\_DB1 to contain all of the chat inputs,

yes that’s exactly what I want, or was hoping.

You say “tag” but I don’t understand what that means in this context. Seeing older videos mentions tags but that just confuses me even more. Is “tag” the same thing as “key” or something different?

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [July 4, 2019, 7:01pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/4 "2019-07-04T19:01:48Z")

</div>

Tag is the same as key (in Classic Thunkable, it is referred to as ‘tag’, but it is the same thing).

So, if you want to ADD to the value in the Database, you would have first to GET the existing content, using the key/tag, then append the new data to the extracted list, then save using the same key again.

You will still overwrite the previous record, but you will be overwriting it with the entirety of its previous value plus the new data, effectively the equivalent of appending.

---

<div class="post-metadata">

### Author: ![solidad](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@solidad](https://community.thunkable.com/u/solidad)
#### Post date: [July 4, 2019, 7:24pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/5 "2019-07-04T19:24:01Z")

</div>

I am really missing something…

![list%20chat%20test%203](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/3/c39366f11f2f5a70a3be3e9f83a91c7585bf9231.png)

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [July 4, 2019, 9:00pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/6 "2019-07-04T21:00:16Z")

</div>

Yes, you are missing something.

What you are getting out of Realtime\_DB1 is “value”; that “value” variable contains a copy of everything that was stored under that key. So what you need to append the new text to, is what you are calling “value”. But you could have put “stored chat\_output” where the green “value” token is, that would have ment 'put the record you get out from the key in “stored chat\_output” ', instead of a local variable named “value”.  
But since your ALREADY intend to have the chat session in the database, why do you insist on having it as a “stored” list as well?

And what you are saving after is STILL missing everything you pulled out in “value”

---

<div class="post-metadata">

### Author: ![solidad](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@solidad](https://community.thunkable.com/u/solidad)
#### Post date: [July 8, 2019, 5:47pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/7 "2019-07-08T17:47:27Z")

</div>

Well, thank you for the help. It did work but of course, opened up a million other problems.

By the way, I didn’t “insist” on anything. I DIDN’T KNOW…Hence, my asking questions.

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [July 8, 2019, 5:49pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/8 "2019-07-08T17:49:35Z")

</div>

“insist” in the context means ‘going out of your way’. That does not imply stubbornness, just that unnecessary and overly complicated steps were taken.

---

<div class="post-metadata">

### Author: ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)
#### Post date: [July 8, 2019, 5:52pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/9 "2019-07-08T17:52:43Z")

</div>

I have successfully got private chat to work in thunkable x, and searching for users.

You must join the original messages, with the new messages, and make sure to **join the new message at the end** of the original list that you get from firebase, to make the chat scroll down as such, instead of up.

---

<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:12pm UTC](https://community.thunkable.com/t/making-a-list-based-chat-but-having-a-problem/131849/10 "2024-11-08T12:12:19Z")

</div>


