We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Issue during extracting data from an excel file using Glide Excel Parser

9shaaby
Tera Contributor

Hi All,

I am extracting data from an excel file using Glide Excel parser. I am unable to identify the end of template.

For ex, if there are 3 filled rows then extraction should stop when the parser iterates to the 4th row. But parser.next() is not working that way. It considers the empty row as a valid row and iterates till the end of the excel sheet. Is there any workaround for this? Can we identify the the empty row (4th row in this example) ? 

1 REPLY 1

sumersingh
Tera Guru

you need to check each row value

 

like i am doing in below snippet code.

 

while(parser.next()) {
var row=parser.getRow();

if(row[h1] && row [h2])
{

//add your code

 

}

}