Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Conditional email flow with Power Apps trigger

(1) ShareShare
ReportReport
Posted on by 12

I want to create a flow that runs when a button in Power Apps is selected. I have the flow inserted on my canvas app in the button's OnSelect property.  Will the flow trigger when this button is selected? Or is there a variable I am missing after the action "When Power Apps call a flow v2"?
Also, I need the flow to check SharePoint for a column called "Branch" and send an email to the correct branch contact. Example:  If the SharePoint column Branch = HR send email to HRcontact@email.com. If Branch = Finance send email to Financecontact@email.com.  

I've gotten a few errors in testing this.. one about the SharePoint Get Items action needing to filter query.  My previous flow with similar logic works fine, the difference is the action is based "When an existing item is modified" for SharePoint and without the Power Apps button trigger. 
Thanks in advance!

  • rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Conditional email flow with Power Apps trigger

    Hi @jrdn03 ,

     

    If I understood correctly, your current flow designer has a When an item is modified, from SharePoint connector, as trigger. To run the flow from a Canvas App button click, you will need to use a different trigger, such as When a Power Apps Call a Flow (V2)

     

    If you want the same button click to both submit the form (which creates the new record into SharePoint) and run the flow, it can be achieved by including both functions in the OnSelect property, separated by a semicolon: 

    rzaneti_0-1720810268113.png

     

    Once we solve this first problem, we can move forward with the show/hide challenge. For that you will be working with the Visible property of your second button.

     

    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.

    http://digitalmill.net/ 
    https://www.linkedin.com/in/raphael-haus-zaneti/ 

  • jrdn03 Profile Picture
    12 on at
    Re: Conditional email flow with Power Apps trigger

    This is helpful. I got the flow to run successfully but not do what I need it to. Here is the process more specifically... 
    1 - User fills out the requirement Form (power app. Data source SharePoint) and when done, selects a "Submit" button. The Form is per requirement.
    2 - The button triggers an email flow with a condition based on Branch.  This is a field on the Form and already filled out. Each Branch has an associated email contact. 
    3 - Email flow runs and checks if the user's specific requirement (the form they have open) has Branch = HR or Finance or IT or etc.. If HR, the flow correctly sends the submission email to HR.  (Note: these email addresses can come from SPO or as typed in the Flow 'Send Email' action)

    My current flow is simple, but does not work with the button. It has a "when modified" SPO trigger and I need the button as trigger instead. For an added layer, I'd also like the flow to know if the button has been selected already and a new button to appear for the next Form user to do their work then submit again, but that time send a submission email to different contacts. I expect this to be more of a function in Power Apps though to show/hide this second button. 

    jrdn03_0-1720805969522.png

     

  • rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Conditional email flow with Power Apps trigger

    Hi @jrdn03 ,

     

    Here is a quick overview on the steps. If something is not clear enough or not actually solves your problem, let me know and I will be glad to try to clarify it. Also, feel free to bring more additional context or share some images from your flow and app.

     

    Running a flow from Power Apps

    If you want to run a flow from a Canvas App, you first need to create your flow with a When a Power Apps Call a Flow trigger:

    rzaneti_1-1720740716813.png

     

    If needed, you can add inputs to the trigger, which will be passed in the Canvas App to Power Automate:

    rzaneti_4-1720741143210.png

     

     

     

    After saving the flow, go to your App and click in the Power Automate icon in the left-side menu (highlighted in yellow), and choose your flow in Add flow. Only flows with a trigger activable by a Power App will be displayed in the list (highlighted in green):  

     

    rzaneti_0-1720740681003.png

     

    In the same menu item, you can see the list of added flows in your app: 

    rzaneti_2-1720740831639.png

     

    After that, you can now call your flow from a button, by setting the OnSelect property as [flow_name].Run()

    rzaneti_5-1720741206230.png

     

    The flow flow parameters must be included inside the parenthesis of Run(), . 

     

    If you followed all these steps when adding the flow to your app, it must be working properly 🙂

     

    Filter query in SharePoint

    The filter query follows a syntax of [column_name] [operator] [value]. The column_name will be the logical name of your SharePoint column; the operator is the comparison criteria that you want to use (equals, not equals, greater than, lower or equal...), and the value is the data that you want use to filter the Get Items outputs.

     

    You can pass dynamic contents in the Filter query, so from your end, the query would look like something similar to this (I had to surround the dynamic content with single quotes, as this is a string column):

    rzaneti_6-1720741518356.png

     

    By the way, I'm using the following List as example, and the flow is intended to return all records which Department is equal to HR:

    rzaneti_7-1720741606872.png

     

    After clicking in the button in the Power App, my flow ran successfully, and I got my results filtered by Department = HR:

    rzaneti_8-1720741673819.png

     

    Finally, I recently wrote an article about how to work with Filter query in Power Automate, which can be helpful for you in understanding this topic: http://digitalmill.net/2024/06/21/working-with-filter-query-in-power-automate/ 

     

     

    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.

    http://digitalmill.net/ 
    https://www.linkedin.com/in/raphael-haus-zaneti/ 

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492