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 / Counting rows from a c...
Power Automate
Unanswered

Counting rows from a csv file

(0) ShareShare
ReportReport
Posted on by 969

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
    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
    969 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
    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
    674 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

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