Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Power Automate Conditions

Posted on 11 Nov 2024 18:26:36 by
Hello,
 
I am new to Power Automate and am attempting to create a flow using the 'Store Microsoft Forms responses in a SQL Server table' template. I have a form with a question (choices) that allows the user to select one of five options. I created a table in my SQL Server with the corresponding choices and set the default value to 'No.'
 

Basically, I want to insert a new row into my SQL Server table with the value the user selected. For example, if the user picks A, the new row should look like this:

A B C D E
True False False False False"

 
Thank you!
 
  • rzaneti Profile Picture
    rzaneti 3,175 on 26 Nov 2024 at 22:23:19
    Power Automate Conditions
    Hi,
     
    I just want to confirm if you had a chance to test the solution recommended in my previous message.
     
    If it's working properly and answered your question, please mark it as Accepted Answer, so other users with the same issue can find it easily in the future :)
     
     
    -------------------------------------------------------------------------
     
  • Suggested answer
    rzaneti Profile Picture
    rzaneti 3,175 on 12 Nov 2024 at 01:53:54
    Power Automate Conditions
    Hey,
     
    I believe that the approach below can help you. 
     
    For this example, I'm using the following Form, which contains a single question and the choice answers (single choice only) from A to E:
     
    The responses must be loaded in this Excel table (from your end, the process may be a little different, since you are using a SQL table):
     
    In Power Automate, I'm simply capturing the Form responses and loading it to the Excel table, with an expression to handle the scenario for each column:
     
    The expressions are pretty much the same: I'm using equals(outputs('Get_response_details')?['body/r3ae835a961be4529b8971a7c84836c82'], 'A') for the a input, and just changing the text in red for the others, in order to match each character from B to E. From your end, you must also replace the text in blue for the dynamic content of the question that you want to track:
     
    In summary, we are using the equals() expression to test if the question's answer is equal to 'A' (or to 'B', or 'C', and so on). Since the equals() expression returns a boolean output, your flow will automatically populate the marked answer as true and all of the others as false. After a few random submissions, this is the outputs in the Excel table: 
     
    Note 1: Power Automate is case sensitive, so make sure to keep the same format from your response in the equals() expression. If I used 'a' instead of 'A', it would not work.
    Note 2: If the choices are not simply a single letter like in my example, you can use some text expressions to extract the letter from the selected choice. Check the content below for more details.
     
    Knowledge base
    Since you mentioned that you are new to Power Automate, I'm sharing some blogs that I wrote about topics discussed here, which can be helpful for you or anyone that finds this thread in the future:
    - Populating Excel table from MS Forms submission with Power Automate: http://digitalmill.net/2024/11/04/populating-an-excel-table-from-a-microsoft-forms-submission/ 
     
    Let me know if it works for you or if you need any additional help!
    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.
     
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,129

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,797

Leaderboard