# Variable inside Text

**URL:** <https://narrat.discourse.group/t/variable-inside-text/206>\
**Category:** Help\
**Created:** [9 May 2024 16:36 UTC](https://narrat.discourse.group/t/variable-inside-text/206 "2024-05-09T16:36:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EE\_Ved](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/ee_ved/32/306_2.png) [@EE\_Ved](https://narrat.discourse.group/u/EE_Ved)\
**Post date:** [9 May 2024 16:36 UTC](https://narrat.discourse.group/t/variable-inside-text/206/1 "2024-05-09T16:36:09Z")

</div>

Hello I am new to Narrat and am experementing with the choice mechanic.  
I wanted to put a number (variable) inside a text so I looking in the Demo and I found:  
“Buy bread (costs %{$$data.breadPrice})”  
however no matter how much I tried, the value will always come up as undefined.  
Is there a way to put a variable inside a text?

---

<div class="post-metadata">

**Author:** ![PinkPenguin](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/pinkpenguin/32/302_2.png) [@PinkPenguin](https://narrat.discourse.group/u/PinkPenguin)\
**Post date:** [9 May 2024 23:38 UTC](https://narrat.discourse.group/t/variable-inside-text/206/2 "2024-05-09T23:38:16Z")

</div>

I’m assuming you are setting your data.breadPrice before hand as follows:

```auto
set data.breadPrice 5

```

Also looks like you have two $. Have you tried with a single one as follows?

```auto
"Buy bread (costs %{$data.breadPrice})"

```
