How to make UiPath print one line after another line using Array variable

Hello everyone, I’m a beginner in Uipath and just started playing around with it.

I just learned array variable and made a workflow where the user enters his/her name and age, after this UiPath writes them in a text file.
Now every time when the user enters a new entry it replaces the previous entry. How can I make sure all my previous entry are maintained in the text file.

Here is the output after entering Superman Kent 56 as the first entry and Batman Bruce 23 as a second entry.

Batman Bruce 23

Expected Output

Batman Bruce 23
Superman Kent 56

Thank you.

Hi @RishiVC1 For new lines you can use Environment.Newline where ever you want to put a new line.
Variable1+Environment.newline instead of Variable1+" "
Hope you are clear.

thanks, @jibanjyoti , I tried doing so but it’s not giving the required output. Previous entries are still getting lost. Any other solution?

Hello @RishiVC1

You can use “Append Line” activity and pass your data with “Environment.NewLine”.

E.g.= Your_data_variable+Environment.NewLine // pass it in "Append Line Activity.



Thanks, @aksh1yadav This is exactly what I was looking for ! :smile:

The final code for Array in append line is bit modified too (Just for reference if someone ever faces this issue)

ArrayStringNameAge(0) +" " + ArrayStringNameAge(1) +" " +ArrayStringNameAge(2) +Environment.NewLine