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 / Count number of matchi...
Power Automate
Unanswered

Count number of matching answers from MS forms

(0) ShareShare
ReportReport
Posted on by 31

Hey,

 

I have a MS forms, which delivers about 100 questions per response. Most of them can be answered as "Ok" or "Not ok", defined by a multiple choice.

 

In my flow, I create a word document out of the answers of Forms and this document will be sent by mail. I want to show in the mail message the amount of given "Not Ok" answers.

 

Is there a way to count this, for example in a loop, instead of having 100 "if answer = "not ok", add 1"...?

 

BR,

smag

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @smag 

     

    You can do the following:

     

    Create an integer variable, initialize it with -1:

    Sundeep_Malik_0-1694518159892.png

     

    Then create a string variable. Initialize it with body coming from get response details:

    Sundeep_Malik_1-1694518192509.png

     

    After this use a compose action and split it on Not Ok with the following expression:

    (Replace ABV with the name of your variable)

     

    split(variables('ABV'),'Not Ok')
     
    After this use apply to each and add the output of that compose in it.
    And use increment variable action in it and increment it by one.
    Sundeep_Malik_2-1694518290029.png

     

    After the apply to each you can use a compose action and add the count variable in it.

    Sundeep_Malik_3-1694518348343.png

     

     

    This will calculate all the not ok responses for you. I have given -1 in the integer

    variable because split will give an extra count so automatically at the end you will

    get the correct count by using -1 in the starting.

     

    Output:

     

    My Form:

    Sundeep_Malik_4-1694518534393.png

     

    Result in Flow:

     

    Sundeep_Malik_5-1694518551196.png

     

     

    I hope this helps 🙂

  • smag Profile Picture
    31 on at

    Hey,

    I testes this one:

     

    Bildschirmfoto 2023-09-15 um 07.20.05.png

     

    Bildschirmfoto 2023-09-15 um 07.18.16.png

     

    But I get this result:

     

    Bildschirmfoto 2023-09-15 um 07.18.00.png

     

    What do I have to change?

     

    BR,

    smag

  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on at

    Hey @smag 

     

    You have to write it under expressions like this:

     

    Sundeep_Malik_0-1694756268445.png

     

    At the end it would look like this:

    Sundeep_Malik_1-1694756285232.png

     

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard