web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to find number of ...
Power Automate
Unanswered

How to find number of rows in Excel table AND add plus one

(0) ShareShare
ReportReport
Posted on by 11

Hello Community,

 

I am creating a Flow which works with an Excel table. The unique identifier of the rows is an index number and there is a do-until within a script. My goal is to have the script run until the last row of the table. Everything is working well, except the total number of rows.

I know the formula to find the number of rows within the table, but since the index starts with 2, the script always skips the last item, meaning I need to add +1 to the below formula somehow.

 

Expression used: length(body('ColumnName')?['value'])
 
Could you please advise how to 'add plus one' to this expression?
 
Thank you!
Categories:
I have the same question (0)
  • sumurthy Profile Picture
    Microsoft Employee on at

    You can us getRowCount() API to get correct row count of a table

     

    function main(workbook: ExcelScript.Workbook) {
     let sheet = workbook.getWorksheet("Sheet7");
     let rowCount = sheet.getTables()[0].getRowCount(); //Doesn't count header or exapnsion row
     console.log(rowCount)
    }

     

  • Verified answer
    Goromi Profile Picture
    11 on at

    In the meantime I have found a much simpler solution. I used the following expression:

    add(1,length(body('ColumnName')?['value']))
     
    Thank you @sumurthy for your help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard