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 get a count of ...
Power Automate
Answered

How to get a count of the number of rows returned?

(0) ShareShare
ReportReport
Posted on by 36,391 Super User 2025 Season 2

Is there any direct way to retrieve the number of rows that are returned from a 'get rows' action?

 

This is what I've tried but it results in the error beneath. Ideally, I'd like to avoid looping around the results and incrementing a variable. Thanks!

 

Rowcount.PNG

 

 

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '1590': 'The template language expression 'length(outputs('GetRows').value)' cannot be evaluated because property 'value' doesn't exist, available properties are 'statusCode, headers, body'. Please see https://aka.ms/logicexpressions for usage details.'.

 

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

    Hi timl,

     

    Hope my steps could be a reference for you:


    1. Configure the flow looks like below, using the actions Get rows and Compose.
        About the Compose action, configure the length function with the dynamic content “value”.

    3.PNG

    2. Save the flow, you will get an error message. Replace the dynamic content “value” with the yellow highlighted part.
        The function in the Compose action would be "@length(body('Get_rows')?['value'])"

    4.PNG

    5.PNG

    3. Update the flow, it will be saved successfully. Then click the button to run the flow, succeed.

    6.PNG

     

    Please try my steps to see if it will work for you. Please feel free reply if you need more help.

     

    Best regards,
    Mabel Mao

  • timl Profile Picture
    36,391 Super User 2025 Season 2 on at

    Thanks Mabel, that works perfectly!

  • 980Panama Profile Picture
    140 on at

    Worked for me too - you need to remember to add double quotes at each end of the compose statement - when creating this in the expression it comes up as invalid so just ignore that.

  • moutinhoabreu Profile Picture
    170 on at
    Hi,,

    I’ve tried with your exoression and returns full content of table not the numeric count
    What could i be doing wrong ?
    Just a remark I’m getting rows on sql on premises and Filtered
  • 980Panama Profile Picture
    140 on at

    "@length(body('Get_rows')?['value'])" in the compose input. length will give the count of rows.

  • moutinhoabreu Profile Picture
    170 on at

    I'm getting this error:

     

    The template validation failed: 'The action(s) 'Get_rows' referenced by 'inputs' in action 'Compose' are not defined in the template.'.

     

     

    Screenshot 2018-11-13 at 21.36.15.png

  • 980Panama Profile Picture
    140 on at

    The name of the ACTION is Get Rows Invoices (hover over the top of value under dynamic content and it should give you the name it is using). I suspect it is Get_rows_Invoices.  Replace Get_rows with this as in "@length(body('Get_rows_Invoices')?['value'])"  

  • moutinhoabreu Profile Picture
    170 on at

    😂

    Yes you were correct.

    Thank you very much.

    I really must invite you one day to support us in our company. 😂

    we use a lot Flow and O365 environment and i'm not a trained It guy

  • 980Panama Profile Picture
    140 on at

    Very happy to help. Smiley Happy

  • entropyeater Profile Picture
    9 on at

    Thanks! Flow has made getting the length of an array as simple as resetting a lightbulb! https://www.youtube.com/watch?v=1BB6wj6RyKo

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard