# \[Solved\] Can I create a function to update Firebase?

**URL:** <https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, solved\
**Created:** [May 8, 2020, 6:52am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085 "2020-05-08T06:52:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![biswajitjei02n8v0iw](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@biswajitjei02n8v0iw](https://community.thunkable.com/u/biswajitjei02n8v0iw)\
**Post date:** [May 8, 2020, 6:52am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085/1 "2020-05-08T06:52:11Z")

</div>

I have a button and when click that button a db should change in firebase depending on the value of current db value.  
now i want to add multiple buttons to same screen . how can i make a function so that i do not have to do  
this

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

every time i create a button.just call the fuction inside “when buttonX click” should work…

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 8, 2020, 8:25am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085/2 "2020-05-08T08:25:09Z")

</div>

it looks like this is what you want. (NOTE: it’s **untested**!)

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

---

<div class="post-metadata">

**Author:** ![biswajitjei02n8v0iw](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@biswajitjei02n8v0iw](https://community.thunkable.com/u/biswajitjei02n8v0iw)\
**Post date:** [May 8, 2020, 9:57am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085/3 "2020-05-08T09:57:04Z")

</div>

yes its working thanks . 😀 😀

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 8, 2020, 11:48am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085/4 "2020-05-08T11:48:27Z")

</div>

If @manyone has answered your question @biswajitjei02n8v0iw can you please ✅ [Mark it as the solution](http://community.thunkable.com/t/saying-thanks-in-the-community/74080)

Thanks!

---

<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, 11:29am UTC](https://community.thunkable.com/t/solved-can-i-create-a-function-to-update-firebase/565085/5 "2024-11-08T11:29:19Z")

</div>


