I want to add data that I have scraped using GetText from a FakeNameGenerator.
I then want to add this data to specific columns in an empty excel file.
Columns:
Name Address Number
Rows:
I have successfully scraped the data but when I try to insert it to the excel file all the data ends up under the first column. But I want the scraped variable “name” to end up under column Name, variable “address” under column Address etc…
How it looks now:
How do I assign the specific data to each column?
I have created a Data Table using “Build Data Table” and set the columns, after that I tried using a For Each Row with a Write range but it doesn’t work.
Fine
–lets go one by one
–may i know what is the value pass in the add data row activity can i have a view on the property panel with a screenshot if possible
–then use write range outside the for each activity
you were almost done
just we need to check the variable assigned to the column
Cheers @goerris
I tried to change the number of iterations on the while loop that scrapes the web site but its still 3 inserts even if I change it. I tried to move the Write Range outside the For Each and the While loop but it still inserts 3 of each values…
After some investigation I see that the ArrayRow is the problem. I changed the Assign arrInfo to only {name, address} which changed the insert number to only two but didn’t fill in the PersonNo column of course…
Any suggestions to what the ArrayRow should be to solve this?
Got it
This will resolve the issue now
—For variable arrinfo change the type in the variable panel as just int32 and default value as 1
—now in the sequence instead of for each loop use a while loop activity and in the condition mention like this Counter > arrinfo
Where the Counter is a variable or type int32 defined in the variable panel with default value as 0
now Inside the while loop have
—Add datarow as we have now
—Assign activity like this Counter = Counter + 1
The reason we were having three elements in the array so the loop was iterating for theee times and that why we were getting triplets of value in our datatable
Yes and Dealy is also playing a role because once you will click on Generate button . webpage takes time to load new data so if you wont use delay then it will scrap the same old user data.