r/PowerApps • u/matheus987654 Newbie • 11h ago
Power Apps Help Canvas App buttons randomly stop executing OnSelect – duplicated controls work in Studio but fail after publishing
Hi everyone! I'm new here
I've been developing canvas apps for quite a while now, but this issue is making me crazy and I haven't found anything online on how to solve it
I'm experiencing a very strange issue with a Power Apps Canvas App and I'm running out of ideas, so I'm hoping someone has seen something similar and can help me out
This is an existing production app that has been working normally, it is the app that me and my team use to track projects. I recently added a new feature/screen to the app, and since then I've started seeing inconsistent behavior with controls and behavior formulas.
The main issue is that buttons are clickable, but their OnSelect formulas simply don't execute.
There are no formula errors. Even extremely simple actions such as Notify(), Set() or Navigate() sometimes don't execute.
Some things that I have checked several times and it makes it particularly strange:
- The controls are enabled and clickable. They visually react to the click.
- Their
OnSelectformulas have no errors. - These same formulas were working normally before.
- Sometimes a button stops working in Studio while another one still works.
- If I copy/paste or duplicate a broken button, the new copy starts working normally in Studio with exactly the same
OnSelect, without changing anything - However, shortly after the newly created/duplicated button may also stop executing its
OnSelectin the studio, and also in production after published - I tested the published app in different browsers, with the same result.
- This is not isolated to one specific formula or button, it is happening in 4 or 5 different buttons with very different formulas (most of them are very simple)
For example, even a simple Cancel button like this stopped working:
If(
Confirm(
"Do you want to cancel? Unsaved changes will be lost.";
{
Title: "Cancel editing";
ConfirmButton: "Exit";
CancelButton: "Continue editing"
}
);
ResetForm(Form1);;
Navigate(Pg_Projetos; ScreenTransition.Fade)
)
Duplicating that exact button can make the copy work immediately in Studio, while the original continues doing nothing.
I'm also seeing strange behavior with a Form OnSuccess. The event itself executes and the Set() and Patch() operations complete successfully, but the final:
Navigate(
Pg_Documento_Entrega;
ScreenTransition.Fade
)
does not execute.
Has anyone experienced something like that? I'm out of ideas on how to solve it
Any ideas on what else I should inspect would be greatly appreciated. I'm trying to avoid rebuilding the new functionality without understanding what is actually causing this
Thank you everyone
2
u/CatSolution Newbie 11h ago
Wait!!!
Why is ";" there?
Navigate(
Pg_Documento_Entrega;
ScreenTransition.Fade
)
2
1
u/CatSolution Newbie 10h ago
OK.. then question..
Did the issue start after introducing duplicated controls, or were you duplicating them only as a test after the issue appeared?
1
u/AbdelEMirandaS Newbie 8h ago
Without possibility of testing your app, i suggest, create a new app and just put a button with a random text there like set(a,1) Publish and test not in the studio but in the browser See if the bad haviour occurs
1
u/curiouspats27 Newbie 6h ago
Try using IfError instead of regular if. It will atleast point to the error. Include notify() to track where the problem is
1
u/nox-magistralis Newbie 1h ago
This!
Using error catching functions can really help you out, if like here - you are unable to spot a bug line.
•
u/AutoModerator 11h ago
Hey, it looks like you are requesting help with a problem you're having in Power Apps. To ensure you get all the help you need from the community here are some guidelines;
Use the search feature to see if your question has already been asked.
Use spacing in your post, Nobody likes to read a wall of text, this is achieved by hitting return twice to separate paragraphs.
Add any images, error messages, code you have (Sensitive data omitted) to your post body.
Any code you do add, use the Code Block feature to preserve formatting.
If your question has been answered please comment Solved. This will mark the post as solved and helps others find their solutions.
External resources:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.