How can I make the Excel file item in the if statement to be repeatedly executed as a for statement?

hello
We implemented a task to find the ranking by the post number in the list of blogs from 1st to 10th, with the top of the search results on the view page as the 1st and 10th from the bottom with Naver designated keyword search.

I want to create an Excel file that collects only the post numbers separately, and instead of typing the post number in the if statement directly, I want to use the for statement to automatically change the post number in the Excel file.

I’m new to UiPath and it’s taking a lot of time to implement. Any help would be appreciated!!

1 Like

Hey @sluree0732

Keep the data in Excel, Use a ForEach Row & CurrenRow(0) will give you the Post ID dynamically which can be utilised in the program.

Thanks
#nK

Hello,

You can read the excel using Read Range activity.
Use a For Each Row In Datatable activity to loop through each row and use CurrentItem(0).ToString will give you the postnumbers. You can pass that value in the if condition.

Hi @sluree0732 ,

Check out the attached sequence. Here I’ve taken two excels

  1. sample URLs in which we need to check for contained values(blogURL.xlsx)

image

  1. IDs which need to be checked(id.xlsx)
    image

The sequence loops through each URL(outer loop) and then loops through each ID(inner loop) and checks if it is contained in the URL or not.
Once a match is found the inner loop breaks and outer loop is executed for next URL.
In place of message boxes you can do your preferred task.

URL-contains_id.zip (14.2 KB)

P.S. This is an easy and unoptimized solution for beginners to understand which does the task. For better optimization and saving time on large datasets there are other solutions(LINQ, FilterDataTable activity and many others) which you can explore.