# Use cases for static variables in Builder

**URL:** https://forum.builder.io/t/use-cases-for-static-variables-in-builder/121
**Category:** Technical Questions
**Tags:** state-and-actions
**Created:** [June 4, 2020, 6:40am UTC](https://forum.builder.io/t/use-cases-for-static-variables-in-builder/121 "2020-06-04T06:40:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![peter.manhof](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@peter.manhof](https://forum.builder.io/u/peter.manhof)
#### Post date: [June 4, 2020, 6:40am UTC](https://forum.builder.io/t/use-cases-for-static-variables-in-builder/121/1 "2020-06-04T06:40:22Z")

</div>

Hi there  
I have 3 use cases I need advice on how to solve in Builder.

Use Case 1: In running text block, refer to a variable refering to any content that might change. e.g Write som variable with some brackets and Frontend returns a name or a static informaiton. The output of the variable can later be changed and then updates the content everywhere. E.g. Our colour is --\> Our colour is red.

Use Case 2: In running text block write Currency and frontend returns the correspoding currency depending on the target option

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/68b7ca0ca06324548083166cd3aaa3a3049203a5.png) E.g. Our currency is --\> Our currency is EUR (if target url suffix has EUR as currency) so there is a need to check for instance if [mypage.de](http://mypage.de) is has EUR in a table or code.

Use Case 3: On any page Change header (separate text block) related to language (that is found in target as use case 2) One live example today is [https://www.myphotobook.at/crm-lp-anniversary](https://www.myphotobook.at/crm-lp-anniversary) and we dont want to build this page in builder for each language.

---

<div class="post-metadata">

### Author: ![aziz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/aziz/32/2551_2.png) [@aziz](https://forum.builder.io/u/aziz)
#### Post date: [June 8, 2020, 5:26pm UTC](https://forum.builder.io/t/use-cases-for-static-variables-in-builder/121/2 "2020-06-08T17:26:48Z")

</div>

Hi Peter, I’m trying to understand the question here, we already have the ability to bind any component option to variables added to `state`, so if you have a text that relies on some variables on the state, you can select it then head to the `Data` tab and bind to it:

 ![Screen Shot 2020-06-08 at 10.16.43 AM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/ea4433e51865647e618c40857856a1bece082987.png)

Choose to bind to `Text`:

 ![Screen Shot 2020-06-08 at 10.16.53 AM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/a47408e5d4f8726acd21f615368202fb5c670d05.png)

Then press `<>` to add code:

 ![Screen Shot 2020-06-08 at 10.20.15 AM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/b82bde214192af0272220d73551fec3b8251393f.png)

This code is actually JavaScript so you can add all the business logic required for your case.

To expose those variable you can add custom code that compute and figure out , current currency, location …etc. For more information please check out [our doc on custom code](https://www.builder.io/c/docs/guides/custom-code).

Screenshots were taken from this example:

> **[Builder: Drag and drop page building for any site](https://builder.io/fiddle/b199636c2f3344ab99353a152b26894b)**
>
> Builder is the first and only headless CMS with full visual drag and drop editing
