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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Counting rows from a c...
Power Automate
Answered

Counting rows from a csv file

(0) ShareShare
ReportReport
Posted on by 1,089

Hello all,

I try to make a Flow for counting rows from a csv file.

 

This what i make but i have the error. What goes wrong?

 

1.png2.png

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @frixel :

    Do you want to get the number of rows in a CSV file?

    Firstly,let me explain why you encountered this problem.

    The point is that the content of a CSV file is a string.

    v-bofeng-msft_0-1623810948884.png

    I think this link will help you a lot:

    What Is a CSV File, and How Do I Open It?

    Secondly,You can get the number of rows by parsing the csv text.I'v made a test for your reference:

    My CSV

    v-bofeng-msft_3-1623811207002.png

    My Flow

    v-bofeng-msft_1-1623811152477.png

    The Restul:

    v-bofeng-msft_2-1623811184590.png

    Best Regards,

    Bof

     

     

  • frixel Profile Picture
    1,089 on at

    @v-bofeng-msft 

     

    Thanks, that really helps me a lot.


    Now I had designated a specific file in my flow (get file content) but how do I adjust the flow if it has to be the file that comes(new) in that folder?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @frixel :

    If you just want to get the newly created file under the specified path, you only need to sort the creation time and get the last record.For example:

    v-bofeng-msft_0-1623824838536.png

    In addition,this is a question unrelated to the current topic, I would suggest you to consider creating a new thread.

    Best Regards,

    Bof

     

  • 55552 Profile Picture
    682 on at

    Thanks, this worked for me!  The only difference was that I had to subtract 2 from the total row count instead of 1. When I created the csv table (from a get rows in SQL table action), the csv table output had the header row, the data rows, then one extra blank row.  Not sure what caused the blank row, but in the end, if I subtracted 2 in the final compose statement, the results were correct.

    Runner55552_0-1630369751370.png

    sub(length(outputs('Compose')), 2)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 442

#2
Vish WR Profile Picture

Vish WR 328

#3
David_MA Profile Picture

David_MA 268 Super User 2026 Season 1

Last 30 days Overall leaderboard