cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
egallis
Level 10

BUG ? Behavior differs between app preview and published app

Hello MSFT guys,

I am facing a different behavior of PowerApps whether I am in preview mode or running the published app.

Here is the case to reproduce:

  • Create a canvas blank app
  • Add a button with:
    OnSelect = Set(gloVar, true)
  • Add a label with:
    Text = gloVar
  • Add a new blank screen
  • On this new blank screen add a toggle with:
    Default = gloVar
    OnCheck = Notify("Hello", NotificationType.Information); Set(gloVar, false)

Now run the app in preview mode:

  • when you click on the button the notification is shown
  • you don't have time to see the swapping of the label because it's too fast (don't care)
  • in fact, everytime you click the button the notification is shown (that's what I expect)

Now publish the app an run the published version:

  • when you click on the button the label goes to TRUE but the OnCheck event of the toggle on the other screen is not triggered

Why is this ? Is it a bug ?

Behaviors should be EXACTLY the same whether in preview mode or on the published app... Otherwise we can loose days and days not figuring out why things are not working (which just happened to me 😞 ).

IMPORTANT: note that if you put the toggle on the same screen as the button, then it works both in preview mode and on the published app.

Personal note: if it is by design it's a real shame because I was planning on using this technique to centralize code on a hidden screen that I would trigger through a global variable...

MSFT guys: thanks for your analysis...

Emmanuel

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: BUG ? Behavior differs between app preview and published app

@egallis @RandyHayes , this is on our backlog. At this time, if you would like to use this workaround with the toggle, you'll need to work within its limits.

 

As for your other question about components, please write a new post so that it is at the top of its own thread and with details on how you made your component. You can include the tag #components.

View solution in original post

6 REPLIES 6
Super User
Super User

Re: BUG ? Behavior differs between app preview and published app

@egallis 

This is actually confirmed.  We recently had a discussion about it in this post.

 

Bottom line is, on your screen with the button, add another control that references the Toggle.  For me, I add a label control with the text property set to : Togglex.Value

I then just make that label visible=false

 

With the reference to the toggle on your screen, it will then work properly in "Play" mode.

Totally agree...design mode and play mode should be equal!

 

Hope that helps you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: BUG ? Behavior differs between app preview and published app

@egallis ,

I answered a similar question for @RandyHayes @vsslasd @KroonOfficeSol here:

https://powerusers.microsoft.com/t5/General-Discussion/How-to-Click-on-a-button-on-a-different-form/...

 

I want to set the expectations here: by design, controls are not meant to trigger their actions while on another screen; they are dormant. Using a toggle on another screen is very much a work around, and as such may not work the way you would expect.

 

If you still want to proceed using this pattern knowing this, you need to do one thing:

  • On the same screen where you want actions to happen, it needs a dependency on the toggle whose actions are being triggered.
    • Display the name of the toggle (e.g. Toggle.Value) in a label somewhere.

 

I think what you're really looking for is a macro though, and I'd suggest upvoting the idea below and similar ones here:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Create-custom-functions-macros/idi-p/6187?advanc...

egallis
Level 10

Re: BUG ? Behavior differs between app preview and published app

Thank you for your insights @Mr-Dang-MSFT. Indeed I noticed that putting a control linked to the one holding the code on a nother screen allowed me to trigger it.

Nevertheless, exactly as @RandyHayes says it here, having a different behavior in design time than in run time should not be. Design preview and run time should behave exactly the same. I personally lost two days of work because of this...

What's your opinion on this particular matter ?

Super User
Super User

Re: BUG ? Behavior differs between app preview and published app

@egallis 

Yes, again I have to agree, design time and play time should be the same results.  I'd rather have something not function properly at design time than the other way around.  Mainly because it makes me wonder...what else is like this that is lurking in the works?

 

The workaround that @Mr-Dang-MSFT suggests is sufficient to resolve the problem, but it doesn't address the concern.  

As for the problem...well, I've got a lot of ideas on that one, but they go more to the core of the PowerApps design itself and given the age of the product, it might be a while until those ideas would ever come to light.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
egallis
Level 10

Re: BUG ? Behavior differs between app preview and published app

Hello @Mr-Dang-MSFT,

About the difference of behavior between design and run-mode, how could we move forward on this problem ? Is there a team inside the PowerApps global team that is responsible for making sure that both design-mode and run-mode behave the same ? And when it's not the case, how can we address the issue ?

It's been a few days now I have another issue with a custom component (very simple one: dialog box with 2 buttons) that makes every screen where I place it crash (the screen does not render). The strange thing is that it works fine in design-mode but not in run-mode... again.

I'd really appreciate it if the PowerApps team could have a look at this issue...

Thanks for your help,

Emmanuel

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: BUG ? Behavior differs between app preview and published app

@egallis @RandyHayes , this is on our backlog. At this time, if you would like to use this workaround with the toggle, you'll need to work within its limits.

 

As for your other question about components, please write a new post so that it is at the top of its own thread and with details on how you made your component. You can include the tag #components.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 348 members 6,350 guests
Please welcome our newest community members: