Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 2UO3HJGU6BYnUoUTmSTHhK
Power Automate - AI Builder
Answered

Problem with how Condition should handle multiple choices answer from MS Form

Like (2) ShareShare
ReportReport
Posted on 16 Apr 2025 12:39:25 by 6
Hello,
 
I have started to learn Power Automate a couple of days ago. Could you help me with the following problem?
 
I have made a simple flow, where Power Automate should send an email if a Forms is filled correctly. If one has checked both "sininen" and "punainen", email will be sent.
 
 
I have tried many ways to get this work. At first I put two lines in Condition Colors:
 
 
Then I added JSON-to-String action and got output string: ["sininen","punainen"]. I tried to extract sininen and punainen to two composes. So that I could use the composes in Condition Colors. It did not work.
 
I also tried this expression in Condition Colors:
and(contains(json(outputs('JSON-to-String')),'sininen'),contains(json(outputs('JSON-to-String')),'punainen'))
 
 
How should I do this? I must say that "contains" from the drop down works well (valitse päävärit contains sininen AND valitse päävärit contains punainen). The problem with "contains" is that the task is to "Select primary colors" in Forms. So sininen (blue) and punainen (red) are the correct selections. Insteads of that merensininen (ocean blue) is not. That's why "contains" does not work.
 
Thank you for your help!
 
  • CU16040858-0 Profile Picture
    6 on 18 Apr 2025 at 08:04:03
    Problem with how Condition should handle multiple choices answer from MS Form
    Here comes current configuration of approval action:
     
  • David_MA Profile Picture
    10,683 Super User 2025 Season 1 on 17 Apr 2025 at 12:10:20
    Problem with how Condition should handle multiple choices answer from MS Form
    Please show the configuration of the approval action. The approval action is not within an apply to each, so I don't see how it could be sent twice.
  • CU16040858-0 Profile Picture
    6 on 17 Apr 2025 at 09:11:45
    Problem with how Condition should handle multiple choices answer from MS Form
    Thank you David!
     
    The flow is working now.
     
    But there is one thing: Why Approval email is sent twice? The Start and wait for an approval action is before the Condition Approval. I noticed that test continues if I accept just the last email.
     
  • Verified answer
    David_MA Profile Picture
    10,683 Super User 2025 Season 1 on 16 Apr 2025 at 19:47:44
    Problem with how Condition should handle multiple choices answer from MS Form
    Try the following:
     
    1. Initialize an integer variable named "Matches" and set the default value to zero.
    2. Add your question that contains the choices to a compose action.
    3. Submit a request to trigger your flow then copy the output of the compose action.
    4. Add a Parse JSON action to your flow and create the scheme from the output in step 2.
    5. Add an Apply to each action pointed to the output of the Parse JSON action.
    6. Add a condition to the Apply to each where the current item is equal to your two choices with an OR condition.
    7. On the yes side of the condition, increment the Matches variable by 1.
    8. After the apply to each, add another condition and check to see if Matches equals 2.
    Your flow will look like this (my test form has different choices obviously):
     
     
    You would then add your e-mail step to the yes side of the final condition:
    By using equals, it must match the case and also be an exact match which will prevent your current issue using contains. Note, this does not do error-checking if the question is not answered, since I don't know if it is required. You may need to make some changes if the question is optional.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,026 Most Valuable Professional

Leaderboard
Loading started