I can't set text from string array[solved]

Hey. I tried set text from string array. When I tried print string It did work but cant set from array. I dont know why.

here’s my script.

Did you copy that ‘Set Text’ node from a normal button (i.e. not an editable button)? Because when I drag a line from an editable text box variable and type ‘Set Text’ in the search, the node created reads ‘SetText (Editable Text)’ and NOT ‘SetText (TextBox)’, like yours does.

Try recreating that node.

Can you show us full blueprint ?

I think it’s not about button because it’s work when I use print string. and also I didnt copy set text . thank for your help by the way

First check if your string variable is not empty. Then when foreach loop ends remove oncomplete pin, because there will be mistake. To detect what is the problem just give to set text node static string Like “hello”. if it completes it means problem is in for loop or in array.
Firstly , remove this pin

oh yes. it’s was my mistake :slight_smile: . but It doesnt work :slight_smile: thanks trying help

when I tried using print string it is work. but it didint set textbox…

Keep going. Now change Set text node with print string, then take a picture to result and upload here

Let me guess. You want to show all this list together yes?


Ok, just to clarify:

  • If you unhook the string->text cast from the button and put some text in the ‘In Text’ box, it works fine (you see that text in the box)?
  • If you print the result of the string->text cast using the ‘print’ node, you see the correct string on screen/in the log?

By the way, what are you trying to achieve? Because the ‘for loop’ is going to overwrite the string in the editable text box each time (i.e. NOT append them). Are you sure, the last string in that array is valid (in that second image, you’ve got the ‘completed’ pin going into the set text node, that’s going to cause problems).

I think there is one problem You are setting last item from your list and i think it’s empty. So lets do this , declare string variable “all text”. and in this variable append all this array elements. like “all text” = “all text” + array[i]. Use append node good luck

exactly. this is helpful answer . it’s working thank you :slight_smile:

Nice , Lastly, check this post solved. Good luck

Can I have a follow up for this question? I also need this result but I need to separate Bus Stop and Pedestrian Area. I need the Bus Stop to be printed below Pedestrian Area. I’m using a textbox and an array to print this. Anyone knows how?