cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

How i can count the number of true

I have Select which take a specific column and i get an Output of:

 
 {
    "True": true
  },
  {
    "True": false
  },
Now next step contains Compose which count the number of
"True": true

I try to use the function:

length(body('Select')?['True'])

but i get an error.

"InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2625': 'The template language expression 'length(body('Select')?['True'])' cannot be evaluated because property 'True' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'."

 
Thanks for your help! 🙂
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @CPKH ,

 

If you want to calculate the number of items whose True field value is true, you could refer to the following method.

Use Filter array to filter out the object with a value of True in Select, and then use the length() function to calculate the number.

12.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @CPKH ,

 

Not sure that is possible with composite step. Once you used the ParseJSON then it will unfold with an For-Each block to iterate the values.

 

Please have a look at this blog.

http://johnliu.net/blog/2018/6/a-thesis-on-the-parse-json-action-in-microsoft-flow

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Community Support
Community Support

Hi @CPKH ,

 

If you want to calculate the number of items whose True field value is true, you could refer to the following method.

Use Filter array to filter out the object with a value of True in Select, and then use the length() function to calculate the number.

12.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (9,223)