cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
teylyn1 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
AnneZC 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")
teylyn1 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,435)