Hello Everyone,
Happy Holidays!
I have added a Power Automate Flow to a button in PowerApps and I want it not to run in case there are any errors in the Form.
I used the same IfError formula as I did for my patch(do not run the patch in case any errors in the Form). However, it does not trigger my from with this error formula. The formula seems fine under the OnSelect property - I get no errors there. The Power Automate flow is triggered in case it is not in the IfError formula, but I only want it to be triggered when there are no errors in the Form. Is there a way to do that with PowerAutomate flow just like with the Patch function?
Solved! Go to Solution.
Hi @Vaida,
Could you make a small adjustment (in your IfError). Between the Patch() and FlowName.Run, there should not be a comma (see your first screenshot) but a semicolon:
//You submit the form and check for errors
IfError(SubmitForm(FormName),
//Notify if there are errors
Notify(...),
//Here you Patch if no errors
Patch(...);
//Run the flow after your patch - no IfError() you already checked for errors initially
FlowName.Run(...)
)
@LaurensM I just figured where the problem: instead of "SharePointIntegration.SelectedListItemID" I added "SharePointIntegration.Selected.ID" and it works now!
Hi @Vaida,
With the current setup you are actually submitting the Form twice if the first one has no errors.
If you only want the flow to run when the Form has no errors, you can just write the code after your Patch() statement, since you already check for errors before the Patch.
There is no need to check for errors on the same form again. Below an overview of how your code structure should look like:
//You submit the form and check for errors
IfError(SubmitForm(FormName),
//Notify if there are errors
Notify(...),
//Here you Patch if no errors
Patch(...);
//Run the flow after your patch - no IfError() you already checked for errors initially
FlowName.Run(...)
)
If this solves your question, would you be so kind as to accept it as a solution.
Thanks!
@LaurensM thanks for coming back to me! I tried this way too - but still the same, my flow is not triggered..
It Only gets triggered when I add it separately without the IfError Formula:
Hi @Vaida,
Could you make a small adjustment (in your IfError). Between the Patch() and FlowName.Run, there should not be a comma (see your first screenshot) but a semicolon:
//You submit the form and check for errors
IfError(SubmitForm(FormName),
//Notify if there are errors
Notify(...),
//Here you Patch if no errors
Patch(...);
//Run the flow after your patch - no IfError() you already checked for errors initially
FlowName.Run(...)
)
@LaurensM I just figured where the problem: instead of "SharePointIntegration.SelectedListItemID" I added "SharePointIntegration.Selected.ID" and it works now!
@Vaida great work! Glad I could be of help.
Would it be possible to close the topic & accept one of the comments as a solution. This way other community members find the solution more easily when they run into a similar problem.
Enjoy your holidays!
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |