cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

flow not starting from PowerApp intermittently

I have a SharePoint list form customized with PowerApps. A button to start a flow becomes visible only after the item has been saved and already has a SharePoint list ID.  The button first changes a variable that sets a status field to "Submitted", then saves the form and then should start the flow, but every once in a while the flow does not start. I can see that the status field is changed and the item was saved, so these two commands were executed fine. Why does the flow not run sometimes?

 

The OnSelect code for the button is as follows:

Set(varSubmitted,true);SubmitForm(SharePointForm1);'MyFlowName'.Run(ID,"tr")

The OnSuccess of the SharePointForm1 is 

ResetForm(SharePointForm1);
RequestHide()

 

What can I do to ensure that the flow runs every time and not just sometimes? 

 

 

2 REPLIES 2
Highlighted
Helper I
Helper I

Re: flow not starting from PowerApp intermittently

Hi @teylyn1 

I think your problem is that when you perform a SubmitForm it's not always successful. Sometimes the data is not valid (e.g. required fields are missing) and the data is not saved or updated. Actions that need to be taken after a SubmitForm has been successful need to be in the OnSuccess property of the form so I would think that your Flow run should be initiated from there.

 

In the OnSuccess property you can access the record from the successful submit by referencing FormName.LastSubmit.FieldName so your Flow Run would be

 

'MyFlowName'.Run(SharePointForm1.LastSubmit.ID,"tr")
Highlighted
Helper III
Helper III

Re: flow not starting from PowerApp intermittently

Hi @AnneZC , thanks for your reply. The SubmitForm was successful, since I can see that data was saved back to the item. I see it in the version history. If there were a problem with one of the fields, then the item would not have been saved. But it has, and the flow still did not run.

 

I also don't want to use the LastSubmit ID, since I already know the ID of the item, as it has been saved before. Maybe a minute ago, maybe yesterday. So I know the ID and don't need to use LastSubmit. 

 

That's why I don't understand how the workflow  won't start in some cases. All the data is there.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,921)