How to read next row (i.e. Current Row + 1) of a particular column in Excel Data Sheet

image

Hey Everyone, I have a data table which looks like the above image.I intend to fill a form online using data from an excel sheet. I am using Excel application scope, using “For each row”. There is condition I want to execute like, while the bot is inserting the data from row 1, it should check for element in row 2 for column A and if the “DocNo” (in row 3 or cell A3) is blank it should check “HsnCode” (row 3 or cell B3). If the “HsnCode” is not blank it should click on a particular element on the webpage and then insert the subsequent data in the webpage for row 3 and after the operation it should continue the activity “For each row”.

@Palaniyappan @DanielMitchell Kindly help

1 Like

@Aditya_Bhalerao Here you go

ExcelCondition.zip (26.7 KB)

1 Like

Hi @Aditya_Bhalerao
Please find the attached flow
Test.zip (25.1 KB)

2 Likes

@kirti.iyer I have an issue, the condition that we have given it says for row(0+1), so the bot always takes value of 1 row , whereas it should go for the row next to the current row. Lets say i+1 row , where i is the current row. How can I do that ?

@Aditya_Bhalerao For that you can do one thing lets say your data table variable is dt
so first of all you can find the index of current row using dt.rows.indexof(row) and save it in a variable rowindex so when you want next row so you can put condition in if activity stating row(rowindex+1).tostring<>“” and then in the then section click on the web page.

@jitendra_123 Thats exactly what I had in mind, but didnt know how to frame the argument.

I’ll try this method and get back to you.

@jitendra_123 This is what i am trying to do, but there is some error. Kindly assist.

Your rowindex variable is of type string Make it int32 another thing you have to do is you have to assign that value inside for each row. your row inside that bracket is row of for each row.

It worked

image

There is also another issue that i am facing which is , after jumping on to the next row and doing its operation (Which we discussed earlier), the bot repeats the row (as For each row activity is being used), is there any other way we could skip or jump to the next row.

Refer above image, using each row activity row no. 2 has be worked with, the based on the condition the bot worked with row no.3 , now by default the bot will again work with row no.3, (But row no.3 has already been used for data input activity). Now I want the bot to skip to row no. 4 to do the assigned activity.

Please let me know if the question is not clear

1 Like

For jumping the next row or how much row you want to skip can you just try to use Counter, assign the value to it accordingly and tell me if it working or not.

Hi @Aditya_Bhalerao
Is this what you want Test.zip (8.7 KB)

@jitendra_123 this isnt working

What issue you are facing?

@Aditya_Bhalerao I have made some changes in the workflow so go through with it. Surely it will help you.Test.zip (18.9 KB)

Let me check and get back to you.

@jitendra_123
why did you use " Totalrowindex-2"

Hi @mozahra
As we are checking data row by row so when our workflow will check the last row it will pop up an error thats why i have taken an condition in if.

1 Like

Hello I am would like to get text for each company and put it in a row for each company with safety details plus getting text from the safety and insurance tables and write them in an excel in each company row and repeat the process for each company then onto the next company I will be very grateful.

https://ai.fmcsa.dot.gov/hhg/SearchResults.asp?search=5&ads=a&state=TN&Submit=Search

https://ai.fmcsa.dot.gov/hhg/SearchDetails.asp?
ads=a&id=30881602&id2=30518138&f=search%3D5%26ads%3Da%26state%3DTN%26Submit%3DSearch

Hi @Aditya_Bhalerao - I’m having the same issue and it seems that your code works. Is it possible to share some of the screenshots of your code for me to try it also? Thank you in advance