I start with assign (intRowCounter = 0)
IdOnCurrentRowIsEmpty = dt1.Rows(intRowCounter)(“Id”).ToString = “”
Then I created this to find if my next row has a ID or not…
IdOnNextRowIsEmpty = dt1.Rows(intRowCounter+1)(“Id”).ToString = “”
and then at the end Im doing
intRowCounter = intRowCounter+1
it works as long my table has next row…
When im at Id (140 or 150) its works but it gives Error when I reach to current row id (160) it gives error on Assign - ‘IdOnNextRowIsEmpty’: There is no row at position 5.
I want to register that Id 160 also in system and get a sysid from system to that sysid colum… which I can not do right now as its giving error on assign.
how to solv this … can someone help…
Instead of checking if the next row is empty, can we check if contains the word “Total” in it ? This way that particular error won’t come.
Please refer the attached screenshot also.
Im using a for each row and its true that this code (dt1.Rows(intRowCounter+1)(“Id”).ToString = “” ) is giving me an error. ExcelFile_1.xlsx (9.0 KB) ExcelFile_2.xlsx (10.1 KB) NextRowValue.xaml (27.9 KB)
Here is the flow and files…
the reason I want to check the nextrowvalue is … sometime i have same use exist 2 time with different price in file… and i do not want to register 2 cases on same user så to avoid that i need to get nextrow data at the same time when i know my next row is same…
and its working…
but problem is due to the difference data of files when my file have Not a row with empty ID number in last its giving error. but the file which have an empty row it working perfect.
I think this will solve your problem, put it in a if action. It checks if the Colum in the row the loop is currently in is empty.
String.IsNullOrEmpty(dt1.Rows(Rowindex or Rowname)(Columindex or Columname).ToString) = False/True… then/else
But obviously you would use in your case a variable Rowindex not the name.
if you want to check for if all colums in the specific row are empty then simply add more like:
String.IsNullOrEmpty(dt1.Rows(Rowindex or Rowname)(Columindex or Columname).ToString + (dt1.Rows(Rowindex or Rowname)(Columindex or Columname).ToString +(dt1.Rows(Rowindex or Rowname)(Columindex or Columname).ToString + …) =…