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!
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.'.
Solved! Go to Solution.
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”.
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'])"
3. Update the flow, it will be saved successfully. Then click the button to run the flow, succeed.
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
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”.
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'])"
3. Update the flow, it will be saved successfully. Then click the button to run the flow, succeed.
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
Thanks Mabel, that works perfectly!
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.
"@length(body('Get_rows')?['value'])" in the compose input. length will give the count of rows.
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.'.
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'])"
😂
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
Very happy to help.
Thanks! Flow has made getting the length of an array as simple as resetting a lightbulb! https://www.youtube.com/watch?v=1BB6wj6RyKo
User | Count |
---|---|
39 | |
39 | |
23 | |
14 | |
12 |
User | Count |
---|---|
27 | |
20 | |
19 | |
14 | |
13 |