# Show a variable value in a Stream Deck button

**URL:** <https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494>\
**Category:** Configuration Help & General Discussion\
**Tags:** stream-deck\
**Created:** [February 23, 2025, 11:42am UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494 "2025-02-23T11:42:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishifter](https://community.folivora.ai/user_avatar/community.folivora.ai/rishifter/32/11656_2.png) [@rishifter](https://community.folivora.ai/u/rishifter)\
**Post date:** [February 23, 2025, 11:42am UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/1 "2025-02-23T11:42:23Z")

</div>

I can use the `{VARIABLE}` syntax to show the variable in HUDs but they don't seem to render in a Stream Deck button. Is there a way to do that? Or a possible workaround?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 23, 2025, 11:53am UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/2 "2025-02-23T11:53:05Z")

</div>

Currently you'd need to use a script widget for that. I'd recommend to use the "Real Java Script" source option:

```auto
async function loadTextWithVariables() {
    let yourVariable = await get_string_variable("BTTActiveWindowTitle")
    return `some text ${yourVariable}`
}

```

 ![image](https://community.folivora.ai/uploads/default/original/3X/7/2/72d9de953ddb59c8868467808a3862c6f9f65ff0.jpeg)

---

<div class="post-metadata">

**Author:** ![rishifter](https://community.folivora.ai/user_avatar/community.folivora.ai/rishifter/32/11656_2.png) [@rishifter](https://community.folivora.ai/u/rishifter)\
**Post date:** [February 23, 2025, 12:20pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/3 "2025-02-23T12:20:47Z")

</div>

Thanks. This works. The only thing is if it's a script widget, then I might as well have the script setting the variable run here (which is what I ended up doing).

Would really be useful to have a regular Stream Deck button which does 2 things

- Gets its text from a variable
- Refreshes the current variable value on press of the button

This seems possible right now if I use a script widget with a very long time (say 24 hours) so it doesn't refresh as often. But for the click-to-refresh to work, there needs to be another script action (which would be the same script as the widget) which if can be avoided would make things simpler.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 23, 2025, 12:27pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/4 "2025-02-23T12:27:54Z")

</div>

Yes, it is already on my todo list and will come at some point, however it's not super simple to add because it requires various state management additions that are currently not included - the current static widgets are very simple without much logic.

---

<div class="post-metadata">

**Author:** ![rishifter](https://community.folivora.ai/user_avatar/community.folivora.ai/rishifter/32/11656_2.png) [@rishifter](https://community.folivora.ai/u/rishifter)\
**Post date:** [February 23, 2025, 12:33pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/5 "2025-02-23T12:33:59Z")

</div>

Thanks. I think even if it became possible to update the title of a static widget/button via scripts, that'd solve the click-to-refresh thing.

Appreciate your quick responses like always, and the amazing app!

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 23, 2025, 12:35pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/6 "2025-02-23T12:35:25Z")

</div>

that is already possible 😉

JS:  
[https://docs.folivora.ai/docs/1106\_java\_script.html#updatestreamdeckwidget](https://docs.folivora.ai/docs/1106_java_script.html#updatestreamdeckwidget)

Apple Script:  
[https://docs.folivora.ai/docs/1102\_apple\_script.html#updatestreamdeckwidget](https://docs.folivora.ai/docs/1102_apple_script.html#updatestreamdeckwidget)

---

<div class="post-metadata">

**Author:** ![rishifter](https://community.folivora.ai/user_avatar/community.folivora.ai/rishifter/32/11656_2.png) [@rishifter](https://community.folivora.ai/u/rishifter)\
**Post date:** [February 23, 2025, 1:01pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/7 "2025-02-23T13:01:00Z")

</div>

Wait is that now supported?! (jumping with joy)

I recall the `update_stream_deck_widget` working only with script buttons on the Stream Deck.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 23, 2025, 1:06pm UTC](https://community.folivora.ai/t/show-a-variable-value-in-a-stream-deck-button/42494/8 "2025-02-23T13:06:15Z")

</div>

That's true, however a script widget without script is basically the same as a static text widget - especially when checking this option:

 ![image](https://community.folivora.ai/uploads/default/original/3X/9/5/95e70270fcc46b06333d42297dbdf4ffbe154d77.jpeg)
