How Can I Count the rows in an Excel

I given excel_content.rows.count… It’s working …Kindly help me with this.

@Bhaskar First, you need to read excel file and save it to variable. Then calculate length of the variable.

@Bhaskar you can use this simple exemple


exemplo2

1 Like

Hi @Bhaskar, Please follow the steps outlined above, @pedro.azevedo, thank you for your contribution to the Community; please continue to respond and assist other users.

1 Like

Hi @pedro.azevedo,

We have tried as per your suggestion. We are getting “Object.Keys is not a function undefined.” error. Find the screenshot for your reference.

Looks like it can be a feature, @g.melihov, @Fernanda_Costa . What do you think?

@Kiran_Yadavalli Hi! Try to change the uppercase letter “K” in “Keys” to a lowercase one in Object.keys(excel_content[“data”]).length;
Please look at this example:

Hi @d.motta ,

I have tried with small “k”. Still i am not getting the result. Find the screenshot.

@Kiran_Yadavalli Please change the uppercase letter “L” in “length” to a lowercase one in Object.keys(excel_content["data"]).length;
image

1 Like

It depends on the use case. Normally you don’t need to just count rows in Excel. You need it to do something else, for example, to iterate through each row in a loop. But in this case, we have an activity called “For each row” For each row – ElectroNeek Help Center where you don’t have to take care of it.

Hi @g.melihov ,
Thanks for suggestion.
We can use “For each row” activity. In case if we don’t have any records we have to send notification mail to respective person. That the reason i am checking the rows count here.

Hi @d.motta
Thanks for the solution. I have changed to small “l”. Now its working and getting the count.

3 Likes

@Kiran_Yadavalli , thank you for the use case.

2 Likes