web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Connect existing flow ...
Power Automate
Answered

Connect existing flow to Power Apps

(0) ShareShare
ReportReport
Posted on by 384

Hi all,

 

I have a flow that currently starts when a new item is added to a SharePoint list.

I would like to start the flow from within a Power App (by clicking a button).

 

1) I am not sure if and how it can be done

2) how do I "tell" the Flow which item it should process.

 

The background of this operation is, that I want to run the flow with the currently logged in user.

Any support is really appreciated.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    To trigger a flow from a Power Apps button it has to use a Power Apps manual trigger.  So to convert an existing flow to trigger from Power Apps you need to remove the automated trigger and replace it with a manual Power Apps trigger.  You'll also need to adjust the flow to provide any information that was originally provided by the automated trigger.  So if a flow was originally trigger by an item being changed in SharePoint you would replace the trigger and add a Get Item action.  Then pass the ID of the SharePoint item to be used in the Get Item.  You can't have a flow that is triggered both automatically and manually from a Power App.

  • Frankie70 Profile Picture
    384 on at

    Hi @Pstork1  and thanks for your answer!

    I did follow your description but I am not sure what to do in the following step:

    Frankie70_0-1615381313990.png

    In PowerApps I do have an ID for the current item, that is written to SharePoint.

    And the connection to PowerApps is not done yet, I believe...

    I might not understand correctly. Could you please assist again?

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    So it looks like you have already used the 'Ask in Power Apps' dynamic content to generate a parameter to pass the ID.  insert the GetItem_Id dynamic content into the id field of Get Item. Then Save the flow.

     

    On the Power Apps side.  Highlight the button you want to use and access the OnSelect property.  Then navigate to 'Power Automate; on the Action menu.  You should see the flow you just saved in the list. Click on the flow to insert it into the Power App.  That will add flowname.run( to the OnSelect property.  Intelisense will prompt you to add any needed parameters.  In your case its probably just 'GetItem_id'. Supply the ID of the SharePoint item there then close the parentheses.  When you click that button it should run the flow on the SharePoint item you supplied the ID for.

  • Frankie70 Profile Picture
    384 on at

    Hi @Pstork1 ,

    the 'GetItem_id' is not done by me...I'm not sure, where it come from 🙂

    In PowerApps I use a variable to read the ID of the newly created item in SharePoint:

    Set(OrderIDVar,
    Patch(Order, Defaults(Order), 
     {
     Purchaser: {'odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     ODataType: Blank(),
     Claims:Concatenate("i:0#.f|membership|",User().Email),
     DisplayName:User().FullName,
     Email:User().Email,
     Department:"",
     JobTitle:"",
     Picture:""
     }, 
     Title:"User created by PowerApps | " & Text( Now(),"[$-da]dd/mm/yyyy hh:mm:ss"),
     Comment: inp_comments.Text,
     Total: Text(Sum(basket, itemprice), "[$-en-US]###,###.00"),
     Approver:{'odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     ODataType: Blank(),
     Claims:Concatenate("i:0#.f|membership|",inp_manager.Selected.Mail),
     DisplayName:User().FullName,
     Email:User().Email,
     Department:"",
     JobTitle:"",
     Picture:""
     }
     }
    ).ID)

    So, what comes in the brackets 'name of flow'.Run(xxxx)? Is it the name of the Variable (OrderIDVar)?

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

     

    This walkthrough explains the whole process.

    Start a flow in a canvas app - Power Apps | Microsoft Docs

    The GetItem_ID came from someone adding the Ask in Power Apps dynamic content to an action called GetItem.  Is someone else also editing the flow?  And yes, the variable would be what you would supply in the RUN() command where you have the xxxx.

  • Frankie70 Profile Picture
    384 on at

    Hi @Pstork1 

    I can not get rid of the GetItem_ID. 

    But in PowerApps I can see this as well.

     

    I just created the flow, so there should be nobody else editing it.

    When entering the name of the variable (OrderIDVar) in the brackets, it gives me an error.

    So, something might not be fitting. Any other idea?

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    Remove the Power Apps trigger from the flow and re-add it.  That should get rid of the GetItem_ID varable.  Then after the trigger is re-added you can create a new parameter by inserting the Ask in Power Apps entry into the ID field of the Get Item. then save the flow.  

     

    Next remove the flow from the Power Apps button and re-add it.  It should ask for the variable you created.

  • Frankie70 Profile Picture
    384 on at

    Hello @Pstork1 

    thank you very much for your patience.

    I just removed the trigger and re-added it.

    Then, when clicking into the Id field, it shows me "Ask in PowerApps".

    Frankie70_0-1615389040960.png

    But when I click on it, it puts GetItem_id into the field.

    Frankie70_1-1615389111589.png

    I am not able to create a new parameter...

  • Verified answer
    Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    GetItem_ID is the parameter.  Inserting the Ask in Power Apps creates that field using the name of the action and the field.  In this case that is Get Item and ID.  If you now save and add that flow to your power app button Intellisense should prompt you to put that parameter in the Run() function.  Make sure its the right data type.  It should be an integer.

  • Frankie70 Profile Picture
    384 on at

    Hi @Pstork1 

    thanks a lot for your help. Now I did understand 🙂 It works now!

    I have one more thing:
    As mentioned above I am doing all that because I would like to send an e-mail out as the logged-in user in PowerApps.

    So, for example, I ordered something in PowerApps and the flow should send an e-mail to the ticket system from my e-mail account. How do I configure that?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard