cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CPKH
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
v-bacao-msft
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
abm
Super User
Super User

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
v-bacao-msft
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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,094)