Skip to main content

Notifications

Community site session details

Community site session details

Session Id : t1NKfnY3XO6CubQNOQxpxq
Power Automate - Building Flows
Suggested answer

Create a endresult depending on Forms answers

Like (0) ShareShare
ReportReport
Posted on 24 Nov 2021 11:27:13 by 53

Hello everyone,

 

so I've created a flow which puts answers that were submitted in a MS Forms into a SharePoint List. After that it "scans" the answers and creates a endresult depending on them.

There are multiple questions with the same selection of answers. There are 4 in total:

 

1. Yes

2. No

3. Not applicable

4. Not reviewed yet

 

And 3 different endresults:

 

1. Approved

2. Not approved

3. Approved but revisit

 

The way the endresults are supposed to work is like this:

 

1. If all the answers are "yes" or "Not applicable" -> Approved

2. If there is one or more "no" answer -> Not approved

3. If there is one or more "Not reviewed yet" answer -> Approved but revisit

 

In this case the "no" has a higher priority than the "Not reviewed yet".

 

The 2. and the 3. endresults are working. I also managed to make the flow put the "approved" endresult in when every answer is yes. But I didnt make it work for answers when there is e.g. "yes" in 3 answers and "Not applicable" in the other one.

 

This is how my flow looks:

 

1.PNG

50c4898d-99e9-49b7-ab67-13150dd9e6dd.png

The "If yes" part looks the same as the other connectors . It is clear to me that this is wrong but , I just testet some things out here.The "If yes" part looks the same as the other connectors . It is clear to me that this is wrong but , I just testet some things out here.

 

Thanks in advance

Kerem

  • Suggested answer
    David_MA Profile Picture
    9,729 Super User 2025 Season 1 on 24 Oct 2024 at 13:55:08
    Create a endresult depending on Forms answers
    I would do it this way:
    1. Create an array variable.
    2. Then for every question on your form, append the answer to the array.
    3. Add a filter array action, and first filter the answers for no.
    4. Add a condition to see if there were any no answers in the array. If so, the request is rejected on the yes side of the condition.
    5. On the no side of the condition, add another filter array action and this time filter for answers that contain Not reviewed yet.
    6. Follow it with another condition to find out how many not reviewed yet answers are in the array. 
    7. On the yes side of the condition, it will handle Approved, but revisit and the no side will handle approved.
    8. Your flow will look like this except after the initialize array action you will have the steps to add the answers to the variable.
    If you add the answers correctly to the array, the array will look like this:
    [
      {
        "Answer": "yes"
      },
      {
        "Answer": "no"
      },
      {
        "Answer": "Not applicable"
      },
      {
        "Answer": "Not reviewed yet"
      }
    ]
    If you use the same format as above, in the conditions you will use the expression @equals(item()?['Answer'], 'no') if your put it into advanced mode.
     
    This is the expression for the Contains No condition to find how the number of no answers length(body('Filter_array_Contains_No')) and this is the expression for the number of not reviewed yet answers length(body('Filter_array_Contains_Not_Reviewed_Yet'))

    Here is a successful run with the above array data:

  • YordiVN Profile Picture
    12 on 24 Oct 2024 at 13:10:56
    Create a endresult depending on Forms answers
    Hi,
     
    The If all "Yes" block is malformed, it'll always return false.
    Because in the logic you want all answers "Yes" Or all answers "Not applicable".
     
    preferably you should do something like this:
    • AND
      • OR
        • AP1 = "Yes"
        • AP1 = "Not applicable"
      • OR
        • AP2 = "Yes"
        • AP2 = "Not applicable"
      • OR
        • AP3 = "Yes"
        • AP3 = "Not applicable

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading complete