Power Apps Canvas application "Division by zero" case

Power Apps Canvas application "Division by zero" case

Working on another app I've tested it and passed to the Client and expecting no bugs reported. But next day I received Client's fedback that once app is loaded "Invalid operation: division by zero" fired up.

This was completely unexpeted and I debuged the app over again to find the cause of that.

Long story short, I used modern dropdown control which should allow user to select number of records per page (in the app I had tabled view with adjustable pagination settings). So, I set control "Items" as set of [10, 50, 100] records and assigned its deault value to 50.

And I used its default value (<control name>.selected.value) in App.OnStart to define gallery items (to display page with 50 items only). Testing app in the Pwoer Apps studio thrown no such errors, however in play mode it seems App.OnStart loads faster than default values are assigned, which cuased issue in my case.

So, just to sumup this short post. Keep in minf two important rules:

  1. Never rely on testing in PowerApps make studio. Before passing app to the Client do testing in play mode (using direct app play link)
  2. App.OnStart loads faster than default values are assigned (even if the value is a simple constant and should be calculated)

Happy power apping to all :)

To view or add a comment, sign in

More articles by Pavel Rudenko

Insights from the community

Others also viewed

Explore topics