# How to add add listener function In DnD

**URL:** <https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228>\
**Category:** Questions about Thunkable X\
**Created:** [August 9, 2021, 9:07am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228 "2021-08-09T09:07:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [August 9, 2021, 9:07am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/1 "2021-08-09T09:07:11Z")

</div>

Hi.  
How to add Add listener function in DnD Cloud 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:** [August 9, 2021, 9:18am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/2 "2021-08-09T09:18:51Z")

</div>

Use the variables. See this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/d/4de0997b2632c4f9ee5181ad7003b3db57f9051a.png)

---

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [August 9, 2021, 9:36am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/3 "2021-08-09T09:36:45Z")

</div>

Thanks @muneer for the response but how can i check an undefined 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:** [August 9, 2021, 9:46am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/4 "2021-08-09T09:46:24Z")

</div>

> [@overturner](#):
>
> how can i check an undefined variable?

Can you explain more?  
A listener is used for a previously defined variable.

---

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [August 9, 2021, 9:47am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/5 "2021-08-09T09:47:19Z")

</div>

ok So i have a cloud variable in place of the firebasedb in DnD. I wanted to add an add listener in that

---

<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:** [August 9, 2021, 9:50am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/6 "2021-08-09T09:50:18Z")

</div>

Define you variable as `cloud` and then use the `initialize or change` block.

This is referring to a node in my Firebase DB  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/9/e9ecebd9b2bc160203799938e84c63358095d25e.png)

---

<div class="post-metadata">

**Author:** ![overturner](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@overturner](https://community.thunkable.com/u/overturner)\
**Post date:** [August 9, 2021, 9:56am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/7 "2021-08-09T09:56:16Z")

</div>

Yes but that variable initializes based upon what i type for group name in text input

---

<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:** [August 9, 2021, 10:15am UTC](https://community.thunkable.com/t/how-to-add-add-listener-function-in-dnd/1439228/8 "2021-08-09T10:15:36Z")

</div>

If it is a `cloud` variable then it is tied with the Firebase DB key not based on what you type in your app. Once your app saves any value under this key or any subsequent keys then the `initializes or changes` event is fired.

---

<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-add-add-listener-function-in-dnd/1439228/9 "2024-11-08T13:17:30Z")

</div>


