# Need Help - How can i set a custom state value through javascript -I am using ToolBox Plugin

**URL:** <https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699>\
**Category:** Need help\
**Created:** [August 8, 2023, 8:04am UTC](https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699 "2023-08-08T08:04:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon71257422](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@anon71257422](https://forum.bubble.io/u/anon71257422)\
**Post date:** [August 8, 2023, 8:04am UTC](https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699/1 "2023-08-08T08:04:52Z")

</div>

i wanted to set a custom state value to 1000 when i click on a button through javascript -  
i was using this in my runjavscript workflow but this didnt worked  
Bubble.set(‘custom\_state’, 1000);

---

<div class="post-metadata">

**Author:** ![adamhholmes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adamhholmes/32/100510_2.png) [@adamhholmes](https://forum.bubble.io/u/adamhholmes)\
**Post date:** [August 8, 2023, 8:35am UTC](https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699/2 "2023-08-08T08:35:40Z")

</div>

Why do you need to?

Just use a JavaScript to Bubble element value instead of a custom state.

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [August 8, 2023, 12:40pm UTC](https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699/3 "2023-08-08T12:40:11Z")

</div>

Hello @anon71257422

Complementing Adam’s guidance this video should help:

[![](https://img.youtube.com/vi/9jVEzPLRebI/maxresdefault.jpg "The Bubble.io Toolbox Plugin | How to save a value from Javascript to Bubble | Bubble.io Tutorials") ](https://www.youtube.com/watch?v=9jVEzPLRebI)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [October 17, 2023, 8:05am UTC](https://forum.bubble.io/t/need-help-how-can-i-set-a-custom-state-value-through-javascript-i-am-using-toolbox-plugin/276699/4 "2023-10-17T08:05:11Z")

</div>

Closed on October 17, 2023, 8:05am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
