# \[UMG\] How to set a text widget dynamically in widget graph?

**URL:** <https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933>\
**Category:** UI\
**Tags:** string, graph, text, unreal-engine, Widget, UE4, question\
**Created:** [May 18, 2017, 10:23am UTC](https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933 "2017-05-18T10:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Starik76](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Starik76](https://forums.unrealengine.com/u/Starik76)\
**Post date:** [May 18, 2017, 10:23am UTC](https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933/1 "2017-05-18T10:23:22Z")

</div>

Hello.  
Is it possible to edit a Text widget with a specific variable (string) in widget graph (for example clicking a button)?  
Can you tell me how?  
Thank

---

<div class="post-metadata">

**Author:** ![MajinSephiroth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MajinSephiroth](https://forums.unrealengine.com/u/MajinSephiroth)\
**Post date:** [May 18, 2017, 10:14pm UTC](https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933/2 "2017-05-18T22:14:51Z")

</div>

You can do that in two different ways.

1. bind

- create a string variable in your widget
- in your design view, click the text widget, and click the bind button next to the text
- pick the string variable
- use button clicks to change the contents of the string variable

1. set text

- in your design view, click your text widget, enable the checkbox that sets as variable right by the name
- in your event graph, make your button onClick events to SetText on your text widget to whatever you want

---

<div class="post-metadata">

**Author:** ![Starik76](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Starik76](https://forums.unrealengine.com/u/Starik76)\
**Post date:** [May 19, 2017, 8:03am UTC](https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933/3 "2017-05-19T08:03:58Z")

</div>

It works! Thank you very much!

---

<div class="post-metadata">

**Author:** ![Speed60580](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/speed60580/32/714397_2.png) [@Speed60580](https://forums.unrealengine.com/u/Speed60580)\
**Post date:** [December 6, 2023, 1:43am UTC](https://forums.unrealengine.com/t/umg-how-to-set-a-text-widget-dynamically-in-widget-graph/393933/4 "2023-12-06T01:43:47Z")

</div>

For me is really tricky.

This is my code

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/3/1e3fd86d1f2f5badda0fe1c09141574e5c30063b.png)

And this is the result after picking two collectibles  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/7/3e70e7b7db81d452f8cb581b6914f1c5c757aabb.jpeg)

Even I put the 0 on the defautl text or add it via on Event Construct

Really Annoying 😕
