Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Create a endresult depending on Forms answers

(0) ShareShare
ReportReport
Posted on 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
    David_MA 8,929 on at
    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
    YordiVN 12 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard