How can i add a new line in between a string , for an entry in dataTable

datatable
activities

#1

I tried to insert environment.New Line in between the string, but it’s now working as expected.

Thanks in advance!!!


#2

Hello @AnoopMP,

Please use Environment.NewLine :slight_smile:


#3

@Rishabh_Lakhera i’ve tried that and that’s not working, Can u suggest if me where i got wrong?

I’ve added the entry in dataTable as

Please correct the errors highlighted in Screen.+Environment.NewLine+Once you have corrected all errors, Click ‘OK’.

And when tried it to display using message box activity, it is getting displayed as such.2018-06-27%2014_50_04-How%20can%20i%20add%20a%20new%20line%20in%20between%20a%20string%20%2C%20for%20an%20entry%20in%20dataTable%20-%20RPA%20D


#4

Try using \n for new line


#5

Still same result :frowning:
2018-06-27%2014_55_31-UiPath%20Studio%20-%20DataTableUsage


#6

Try,

“this is first line” + “\n” + “this is second line”
OR
“this is first line” & vbnewline & “this is second line”
OR try following other ways,
Environment.NewLine or vbCrLf or Constants.vbCrLf


#7

I think as the column is of string type ,whatever you write inside it will be treated as a string.
I tried putting an integer variable there, it still doesn’t interpret it as a variable it is just assuming it to be a string and printing it as it is.


#8

@RupeshGonte Tried all those, still it’s having same issue.

I’ve uploaded the xml. Can u please help?MainPage.xaml (6.5 KB)


#9

@Rishabh_Lakhera Yeah…Same reason i guess… Any workaround available for that?


#10

Hi @AnoopMP,

I have idea, that you use “add data row” to add variable to datatable
p/s: wait me a sec to upload xaml

regards


#11

I’ve tried all those @AnoopMP doesn’t seem to work!

Although if this is what you’re trying to achieve , this is how i did it

Main.xaml (9.9 KB)


#12

Whatever you write in the Message info is converted into string by:
Text="[DTOutput.Rows(0).Item(0).ToString]"

One solution I see is to include spaces, as in any window sizes, size of popup box won’t change.


#13

Hi @AnoopMP,

this is xaml. I just build a datatable . And I use add datarow
Main.xaml (7.2 KB)


#14

hi @AnoopMP,

Does my case help u?


#15

Hi @AnoopMP
You can simply write \n instead of Environement.NewLine in your data row message.
Then you can Replace \n with Environment.NewLine at the time of usage.
Please refer this workflow Main (1).xaml (10.1 KB)

Thanks