How to get the row data from web into each column of datatable

Hi,

I am trying to fetch the all the record from below row:

And want to add this data into each separate column I have created in data table with the same name of row column.

Can anyone please help me with this.

Did data scrapping method worked here
Cheers @ShenkiSinghai

Thanks for reply. But I don’t want to use DataScrapping.

What I want to do is pick the data from this row and keep all the data into the datatable I have already defined.

Data scrapping is most efficient method in this case
or we can try with SCREEN SCRAPPING as another choice if the table is not a element rather a image
or
we can use FIND CHILDREN activity and get the rows detail as a ienumerable

–Fine we still have choices to get the data from this single row, but it includes a lot more process that would make the sequence more complex buddy
anyhow here you go
–we can use ANCHOR BASE ACTIVITY where we can use Find element activity in the left side of the Anchor base activity and choose the column name as element and in the right side of the anchor base activity use GET TEXT activity and get the value as output by choosing that as a element
–once after getting the output with a variable of type string then repeat the same for all the columns with n number of Anchor base activity (hope you understood the complexity)
–after that we can use ADD DATAROW activity where in the property panel along the datatable mention the datatable you have and in the ARRAY ROW property mention the output variable of each anchor base activity as a value like this
{variablename1,variablename2,variablename3…variablenamen}

hope this would help you
Cheers @ShenkiSinghai

Thanks @Palaniyappan

And yes, I agree the complexity will be more as we have to use n anchor based activities.

The more I am thinking on this to make it more optimize. What I have in my mind is to use gettext activity under while loop and store the text into the collection list. So, we will have all data in our collection list. Now can we use this collection list data to fill our datatable? if yes, then how? Please suggest.

yah of course
once your list variable is ready
we can pass that as input to ARRAY row property in add data row activity like this
listvariable.ToArrya().ItemArray
and in the datatable property mention the datatable name

Cheers @ShenkiSinghai

Thanks @Palaniyappan.

I have tried this and getting below error, can you please have a look what this is all about?

Tried below also.

Below is my data table.

1 Like

aah sorry just an array it was a typo mistake
listvariable.ToArray

Cheers @ShenkiSinghai

Thanks. I have changed it. But it is giving me output like this.

image

I have uploaded my project, can you please have a look. What’s wrong here.

NSE.zip (45.4 KB)

Hi @Palaniyappan

Any leads Sir?

1 Like

sorry for the delayed response
let me check once

Cheers @ShenkiSinghai

Thanks @Palaniyappan

I got it what I was doing wrong.

In AddRow I have entered {row.item("Name"),List1.ToArray()}, because in my data table first column is Name, where I want to put the data from my excel sheet. And rest column I want to fill by my List.

Now can you please suggest how should I achieve this? If I remove row.item("Name") from AddRow then in this case all data from list is going into the all columns of datatable but in wrong columns.

My expectation is to fill first column of datatable from excel and then rest column from my list.

1 Like

no worries
i hve attached a xaml
before ADD DATAROW ACTIVITY use a INVOKE METHOD activity where in the property panel of invoke method activity we got a property called Parameter
where in place of “bye” mention as row(“Name”).ToString
and in the Invoke method activity instead of variable1 mention as List1

–this will add the value of Name column as a first element in the list
so once after this in the array row property of add datarow activity mention simply like this
{List1.ToArray}

insert.zip (10.4 KB)

hope this would help you
Cheers @ShenkiSinghai

1 Like

kindly let know for any queries or clarification
Cheers @ShenkiSinghai

1 Like

Yes, was just about to reply. Getting below error now at invoke method

1 Like

while creating a list variable create it with string type
like for the variable List1 declare the type as
system.collections.generic.list(of string) and in the default value as new list(of string)
and make sure that the Parameter property of invoke method activity is given with those two values like 0 and the row(“Name”).ToString (its there in the xaml provided along the property panel of Invoke Method)

Cheers @ShenkiSinghai

1 Like

Got it, corrected parameters. I have not used int32 once (What’s the purpose of this parameter). Regarding the list variable I have purposely set it to ICollection(Of Object) type because I am getting below error while adding the values to List using Add To Collection activity.

How to get rid of this, then?

kindly change the type argument from object to String in the property panel of the ADD TO COLLECTIONS activity
@ShenkiSinghai

1 Like

Thanks it helps. But now getting below:

image :frowning:

Fine
Are we adding the row(“Name”) to the List1 variable as a new value at first position or replacing the first element
@ShenkiSinghai