I have a data table that was created using the data scrapping tool. The second column in the data table is a url. For each row, I am trying to pull the URL from the data table, open the url in a browser, perform a set of activities, then move to the next row / URL.
I have the activities defined, but I am very new to using “For Each Row” activity or working with data tables.
Hi
Welcome to uipath community
Hope this would help you resolve this
— let’s say your datatable variable obtained from scrapping is named as Extractedtable of type datatable
— now use a for each row activity and pass the above variable as input
— inside the loop use a open browser activity and mention the url property as row(1).ToString
— this will open the url through browser
— now let’s see how the above steps works
For each row loop will usually iterate through row in the datatable one by one
—So for one loop I.e., for one iteration one row will be taken and that is carried by the variable of for each row loop named row
—Now row(“columnname”) will give the value of the mentioned column in the row which is in iteration
Here we can either mention as row(“columnname”) or row(columnindex)
Like either row(“URL”) or row(1)
Where 1 represents the second column index and index usually starts from 0 for the first column
Hope this would help you
Kindly try this and let know for any queries or clarification
One point to clarify on the open browser step. The url in the table is actually the unique back half of the url based on the corresponding name within the row. So what would be the syntax to add a string in front of the "row(1).ToString.
@Palaniyappan
I am also facing some similar kind of issue. Your above resolution helped me to resolve the issue partly. My data table has all types of URLs meaning windows explorer’s and web url. I now want to skip windows urls and try selecting only web urls.
How to check the each URL is a web url using If condition. I can only proceed with Opening a browser if it is a web url else I need to skip it and append the spreadsheet with the message in a new column.
I have tried it this way but I am still not sure if the ’ Then’ condition would work and browser would open and paste each URL everytime. Can you please validate?
Another issue that I am facing is the browser does open up but the url are not picked up from data table and pasted in the browser for further processing.
No buddy
You have missed few things
Don’t use IF condition
That stroutput should be in assign activity
—and stroutput should be again passed to open browser
oh okay, so you mean to say I need to use two assign activity one for assigning strinput variable and then another assign to pass stroutput following by open broswer
I tried what you suggested, it’s somehow not working for me. The data is available in the data table and the open browser activity opens up new sessions each time however the urls from the data table are not getting selected and pasted in the browser. Pls see below if the approach is correct: