# Add String to Array (+1); feed whole Array to Widget

**URL:** <https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371>\
**Category:** UI\
**Tags:** string, unreal-engine, Array, Widget, question\
**Created:** [April 4, 2021, 3:17pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371 "2021-04-04T15:17:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [April 4, 2021, 3:17pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371/1 "2021-04-04T15:17:52Z")

</div>

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/5/d6532d61f0f48f6a5568ba68e5da8ebe1b99d3b6.jpeg "example") ](https://www.youtube.com/watch?v=ict-AprTGNU)

About an hour trying to formulate this, hope it’s understandable.

Game’s scenario: An actor scans an object and then creates a String.

I want to save these generated Strings into a GameInstance Array, line by line (element for element) incrementally.

* * *

- Game Instance where the notebook is:

![334699-gameinstance.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/b/61b574262567b1bcec06e931999f726d3b10e216.jpeg)

* * *

- The scrollbox text, which must receive the full array like a diary.

![334698-autoscrollbox.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/d/c/7dcf39c301b2342ba6fb9fff150207e8ab6db506.jpeg)

* * *

- Actor BP where the reading is done and the String is being forged. I need some help if i should use “Insert” or another way to feed the actor’s string into the notebook array.

 ![334694-prob2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/b/1eb08853a79f4eca3710d1400117ba8cb5d42c74.jpeg)

* * *

- Widget BP that should read the Array. The best i could to is geting the Last Index, anything else didn’t work, and i wouldn’t want to use ForEachloop in a widget:

 ![334690-prob1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/7/d07aa363d73de3a94a697fff05f38feee23bedd4.jpeg)

* * *

- Visual explanation…

![334696-exa.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/3/7635691dc053a1b8dd30306362d3138e9e287563.jpeg)

Large purple box is the notebook String array. The plus on the bottom of the box means automatic incrementation when another random string is added.

* * *

---

<div class="post-metadata">

**Author:** ![GrumbleBunny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumbleBunny](https://forums.unrealengine.com/u/GrumbleBunny)\
**Post date:** [April 4, 2021, 4:06pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371/2 "2021-04-04T16:06:06Z")

</div>

1. You can use Add to add the strings to the array. New entries will be added at the end.
2. You can use [Join String Array](https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/String/JoinStringArray/index.html) to join the entries together, using “\n” as separator to put each one on a new line.

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [April 4, 2021, 4:14pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371/3 "2021-04-04T16:14:04Z")

</div>

Trying Add again;

 ![334717-add.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/0/d80eade06493e5d3421d6c90607b23063cb3b7ec.jpeg)

How should i hook up the Widget text return node? (Because of the index)

 ![334718-text.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/6/f26a85a005827549cb71c23cd130ae91c298ca84.jpeg)

---

<div class="post-metadata">

**Author:** ![GrumbleBunny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumbleBunny](https://forums.unrealengine.com/u/GrumbleBunny)\
**Post date:** [April 4, 2021, 4:15pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371/4 "2021-04-04T16:15:56Z")

</div>

Use the Join String Array node. It takes the array as a parameter and joins all elements together into one string with a separator in between them [Join String Array | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/String/JoinStringArray/index.html)

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [April 4, 2021, 4:40pm UTC](https://forums.unrealengine.com/t/add-string-to-array-1-feed-whole-array-to-widget/481371/5 "2021-04-04T16:40:14Z")

</div>

Seems to append…Nice one.

I looked at this node multiple times but thought it’s gonna make it all inline. After 20 hours of craze it turned out that was it…🙂

I appended some line breaks.

Widget Result:

![334731-widresult.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/5/ed5f4950ba05d81be087cff6af6302381dede45f.jpeg)

 ![334720-textresult.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/e/95e3c120876e2b21895bc01636d17d89cc75c814.jpeg)

Solved so far. Thanks!
