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 Apps / Counting the number of...
Power Apps
Suggested Answer

Counting the number of rows on a dynamic CSV file

(1) ShareShare
ReportReport
Posted on by 10
Hi, 
 
First poster here as I'm new to the work of Power Automate. 
 
I have created a flow so that when a new email arrives with an attached CSV file, this file will then be moved into a SharePoint location, so far so good. This is a flow which is scheduled to run whenever a new email is received (twice a day in this case) and the file is replaced with a new updated file twice a day.  The data in this file is a list of contacts in the past 12 hours and is not in a table format.  
 
I also have a master spreadsheet, also located in Sharepoint,  I want this master spreadsheet to look at the new updated CSV file and count the number of rows on the new updated CSV file that we get delivered twice a day,  Ideally I would want to do a Countif function so I can include various cout criterias.   
 
I have the below flow so far, and as you can see, I have a excel formula to count the number of rows - =COUNTA('Incidents logged in the past 12 hours.csv'!A2:A1000).  This works initially and adds a new row to a table on the master spreadsheet (which is what I want) and adds the value I am after.  However, when this file is updated later on in the day with a new CSV, it adds a new row in the master spreadsheet but with the old number and not the new updated figure.
 
I'm pretty sure I need a dynamic instead of a basic 'Counta' function, but this is where I get lost. 
 
Is there a way I can update this flow to have a new row added every time I get a new CSV delivered and also count (with a few criterias) the new number f rows on the new spreadsheet. 
 
As you can see I am using the new flow designer, but would it be any better in the old flow designer? 
 
 
 
Many thanks in advance. 
 
Categories:
I have the same question (0)
  • Suggested answer
    MichaelFP Profile Picture
    1,847 Super User 2025 Season 2 on at
    Use the Get list rows in a table point to your csv file
     
     
    after that you can get the count using the Length() to get the cound.
     
    Like This
     
    length(outputs('List_rows_presente_in_a_table')?[body/value'])
  • Shopps Profile Picture
    10 on at
    Thanks for the quick response MichaelFP.
     
    Can I ask where does the 'List rows present in a table' fit into my flow in the screenshot?  would this extra step need to be between Get file content and Add a row into a table, or would this extra step work as a parallel branch? 

    I have tried the below and added this step between the Get file contents and Add a row to a table step. I have entered my file paths etc, but what exactly would I need to out where in this screenshot? 

      

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard