In Uipath Guide: Table functions

I tried to create a Table function by retrieving an excel password but I couldn’t understand the Array which is written in Writeline. If you understand please make me also. How do we get
String.Format("{0,-15} {1, -30} {2, 10}",
Attach is the screenshot.

1 Like

Fine @ramkrishna2k3
Is just alignment argument passed along with the index in string.format method
That is
String.Format("{0,-15} {1, -30} {2, 10}",row(Invoice"))

Where {0,-15} means
0 is the index position of where this invoice value will replace and -15 means left alignment means the number a space for 15 position…with text in left side and spaces in right side
And if it is in positive 15 it will go for right aligned
Thats all buddy

Kindly have a view on this buddy for more info
At this topic

Alignment and spacing using String.Format

if you don’t mind can you point the value ("{0,-15} {1, -30} {2, 10}" in the above excel.I am quite dump in programming.

Can somebody help to Understand the Write range Array ( String.Format("{0,-15} {1, -30} {2, 10}",)

1 Like

Fine no worries
the string format is like this
String.Format("{0,-15} {1,-30} {2,10}",row(“Invoice”),row(“Name”),row(“Work”))
the output for first row from the excel would be like this

0,-15 means 15 position left aligned
value of Income in the first row i.e.,
where | is the space that 15 position left aligned (as the value is mentioned in negative -15)

so for Name
1,-30 means 30 position left aligned
Almaguer, Philip
Almaguer, Philip|||||||||||||| (just to highlight space i have used | symbol)

and then for Work
2, 10 means 10 position right aligned (as it is a positive value)
Police Officer
as the total length of string Police Officer is 14 which is more than 10 as mentioned in (2,10) in the string format, it is mentioned as it is
for instance if the work is just Police then the output would be like this

Simple buddy

hope this would help you
Cheers @ramkrishna2k3

Thanks, Your Explanation is true, but again my question arise, like how do we come to know or understand in excel that 0,-15 is 46206, including gap this calculation, makes me :frowning:

1 Like

this string format in write line activity is inside a for each row loop buddy
so the write line will display each row one by one from the data table read from excel
you have already highlighted
and each position of {} is replaced with value in order next to , after “{} {} {}”
{0,-15} {1,-30} {2,10}”,row(“Income”),row(“Name”),row(“Work”)
“{0,-15} {1,-30} {2,10}”,row(“Income”),row(“Name”),row(“Work”)
“{0,-15} {1,-30} {2,10}”,row(“Income”),row(“Name”),row(“Work”)

Cheers @ramkrishna2k3

Did this get resolved
any issue still buddy
Cheers @ramkrishna2k3

Still, Have a doubt how to identify those numbers {0,-15} {1,-30} {2,10} in excel. I tried changing the numbers but the output was the same as before.

which numbers you want to identify buddy
i didnt get this
these {0}{1}{2} are just index position where we are trying to replace with value of row(“Income”), row(“Work”), row(“Name”)

and in addition we are mentioning the alignment index as well thats all
like this
{0,-15}{1,-30,}{2,10} and these -15, -30 and 10 values are defined by us , we can change on our need of how the output should display… while 0,1,2 to the left of these values of index position buddy
Cheers @ramkrishna2k3

Oh OK ! now i understand.

Cheers @ramkrishna2k3

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.