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 Apps / How to Trigger a Flow ...
Power Apps
Unanswered

How to Trigger a Flow From PowerApps within OnSave Event.

(0) ShareShare
ReportReport
Posted on by 5

I have a simple power app that customizes the form from SharePoint.  Within the app I have several forms (New/Edit/View)... From the Edit field I have two buttons (Details and Comments).  I am using the Comments Button(tab) to allow people to submit comments.  Most will not have access to the other fields linked to the Details button).  From that comments area there is a field called comments that I patch to another list...  and stores the comments ( I do this within the OnSave Event) when they click save (it checks to see if the field is blank or not first).  Then in the view form I can pull all of the Comments and view them ... OK no problem with that.

 

Now I have a flow that on New it does stuff... and in the old version of WorkFlows I was able to create elaborate things easily... but since I am new to PowerApps and Flow... I am getting lost int he complicated logic... so I will create a few flows to do what I did with one before.... So on New Sharepoint item... it will run a flow and does stuff.... What I want is to run another flow if someone enters and saves a comment.... So in my head it should be easy... on the save click... it does what it does and immediate after if fires off a trigger to a flow... that does what it does (like send an email or ? really doesnt matter just want to trigger it).  

 

I have not been able to find the simple code that would be needed to trigger a flow... (or any examples)... Most examples are on new apps... but not on Customized forms...

 

 

(Here is a pic of the onSave Event that I have been using to test this all out)ITHelpHelp.jpg

 

 

thanks in advance, 

 

Rob

Categories:
  • rebeccas Profile Picture
    2,591 on at

    To trigger a flow from Powerapps you have to create the flow first and then go back to PowerApps and put in the run code.

     

    Your trigger would be PowerApps and then I would suggest (since your using a SharePoint list) you do 'Get item' and you will ask for the ID of that item in PowerApps. 

     

    Then in PowerApps you would need to run the flow on the OnSuccess of your form (are you using a Form?)

     

    I did a video a while back that is not related to what you are needing but it does have a flow triggered by PowerApps just to give you some ideas..its here:

     

    https://youtu.be/UdbNqQ1z_Ww

     

  • LBGrob Profile Picture
    5 on at

    I will check out your video.  I have a flow to run... my problem is trying to get it to trigger from the onSave Event (see picture in initial post).  I figure just after the patch I could put a ; and a command that triggers it.... but I dont know what the command would be to trigger it... thought it would be easy (probably is)... but cant seem to find out what I am looking for... 

     

    Basically what I am trying to do is trigger the flow to send a note saying a comment was added to this item... 

     

    thanks for the reply and I am going to watch your video now.

  • rebeccas Profile Picture
    2,591 on at

    You have to connect to the Flow in your app and then you use:

     

    FlowName.Run(Ask1, Ask2)

     

    Ask1 and Ask2 being whatever the fields in your Flow are that you selected 'Ask in PowerApps' for.

  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @LBGrob ,

     

    First of all, is it a standalone app created from PowerApps site or a customized form created from SharePoint site?

     

    To start a flow from PowerApps, please refer to:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

     

    Regards,

    Mona

  • LBGrob Profile Picture
    5 on at

    Not sure if I am stating this correctly but it is a PowerApp that customizes the forms in sharepoint.... so I got there from sharepoint.  I created 3 forms (new/view/edit)... in the edit form I want to trigger a flow that I created through sharepoint (or I guess create one in powerapps) that sends out an email on the onSave event of powerapps... in this email I want to include the ID of the sharePoint entry that was being edited.

     

    so what I have been able to do is call a flow created through power app in the onsave event... I just am not sure how to pass on the ID variable from the form. 

     

     

    Here is the latest code in the OnSave Event in SharePoint Integrations:

     

    If(SharePointFormMode="CreateForm", SubmitForm(spFormNew),
    If(SharePointFormMode="EditForm", SubmitForm(spFormEdit); If(!IsBlank(txbComment.Text), Patch(ListComments, {Title:"SomethingwillGoHere",ListName:"ITHelp",ItemID:SharePointIntegration.SelectedListItemID,Creator:User().FullName,Comment:txbComment.Text}); FlowFromPowerAppComments.Run(spFormEdit.LastSubmit.ID))))

     

    I am using the.LastSubmit.ID for a lack of a better thing to use... it was the only one I could find to get the ID...but in the flow I couldnt call it... any thoughts on this.... the Flowname.run does call the flow.... and I can have it send an email...but havnt been able to pull info from the edit form.

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard