Output data to a specific data table and column

Hey there! I have 3 data tables: ExtractDataTable, ExtractDataTable2, and ExtractDataTable3.

The first and second dt’s I have no issues with because it’s running through a for each loop. I can specify the output column of an activity to be to be row(0), row(1), row(2), etc.

However the 3rd dt does not use a for each loop as the data is not structured… So how do I specify that I want my Get Full Text activity for example to output to ExtractDataTable3 in the second column.

I have tried so many things… Searched this forum for hours and looked through the documentation… ExtractDataTable3.Columns(1) Does not work… Would anyone have any thoughts or resources I could read? Thanks so much!

1 Like

Buddy @Zer0_0

welcome to uipath community buddy

Once you have the datatable ready
ExtractDataTable3.Rows(0)(1).ToString

This will pass the value to first row and second column cell buddy @Zer0_0

for both row and column index start at 0, so you can make adjustments accordingly buddy @Zer0_0
Kindly try this and let know buddy
Cheers @Zer0_0

2 Likes

hi @Zer0_0

Is the headers for Extract Structured Datatable 3 shown as Column1 ,Column 2

etc

Thanks
Ashwin S

Did that work buddy @Zer0_0

Thanks, but Rows is different from Row. I need to specify the datatable and column for my activity to place the data into.

When the for each loop is used Row(1) would be Column 2. But since I am not using a for each loop here how do I specify: ExtractDataTable3 in Column 2?

I tried it, but it says invalid L-Value expression

Yes buddy row is different from Rows
row - we get from for each row loop as a variable of type datarow
Rows - It is a method of datatable, say a property that can get and set values and we have like this


and it has two arguments that can passed
where the first argument specifies the row index

while the second one specifies column index see buddy
image

1 Like

Buddy may i know how you passed the value and with which activity
Cheers @Zer0_0

Thanks a ton for your help! I am using Get Full Text with your line in the Output>Text property and Get Attribute with your line in Output>Result

No worries buddy, lets go one step at a time
Buddy kindly tell me one thing @Zer0_0
you want to give a input to the dt3 or you want to extract from dt3

Cheers

1 Like

Input to dt3

great
so do you know to which row and which column you want to pass it…
@Zer0_0

I want to add data to the second column. Should create a new row for each entry.

1 Like

say if you the input of type string and is named as a variable inText

now
–use a assign activity and mention like this to add a new row
dt3 = dt3.NewRow


–then use a assign activity to assign the inText value to that second column in a newly added row
like this
dt3.Rows(dt3.Rows.Count-1)(1) = inText.ToString

simple buddy
try this and let know buddy
Cheers @Zer0_0

1 Like

@Palaniyappan You’re helping me a lot. Thank you so much. Some of this is a little beyond me still. I’ve just now started playing with assign activity.

My goal is to have my Get Attribute activity write to ExtractdataTable3 in Column2

How would assign work with my Get Attribute activity? Would you mind elaborating a little more?

1 Like

Buddy @Zer0_0

Basically get attribute is used to retrieve the value of a specified attribute of a UI element.
the output will of type string and so you can create a variable as suggested previously like inText of type string and mention this in output property of Get Attribute Activity buddy
for more info on get attribute here you go

Kindly try this and let know buddy
Cheers @Zer0_0

did that work buddy @Zer0_0

@Palaniyappan So in the properties of my Get Attribute Activity under Output>Result I would put my variable?

Then my work flow would look like:

1.Assign Activity:
dt3 = dt3.NewRow

2.Get Attribute Activity:
Under Properties>Output:
**Variable

3.Assign Activity:
dt3.Rows(dt3.Rows.Count-1)(1) = variable.ToString

Is this correct?

1 Like

yes buddy @Zer0_0

but may i know why you are using get attribute here buddy… @Zer0_0