Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

BUG ? Behavior differs between app preview and published app

Posted on by 1,594

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

Categories:
  • RaymondWood Profile Picture
    RaymondWood 61 on at
    Re: BUG ? Behavior differs between app preview and published app

    Is this issue still in backlog or has it been addressed? I have an issue that is similar in that the Published vs the Previewed app behave differently. For me, some of the controls in some canvas components are rendering at different sizes.  See First Instance of Canvas Components are Rendering Incorrectly 

  • Verified answer
    Mr-Dang-MSFT Profile Picture
    Mr-Dang-MSFT on at
    Re: BUG ? Behavior differs between app preview and published app

    @R3dKap @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.

  • R3dKap Profile Picture
    R3dKap 1,594 on at
    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

  • RandyHayes Profile Picture
    RandyHayes 76,308 on at
    Re: BUG ? Behavior differs between app preview and published app

    @R3dKap 

    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.

  • R3dKap Profile Picture
    R3dKap 1,594 on at
    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 ?

  • Mr-Dang-MSFT Profile Picture
    Mr-Dang-MSFT on at
    Re: BUG ? Behavior differs between app preview and published app

    @R3dKap ,

    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/m-p/269011#M78598

     

    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?advanced=false&collapse_discussion=true&filter=location&location=idea-board:PowerAppsIdeas&q=macro&search_type=thread

  • RandyHayes Profile Picture
    RandyHayes 76,308 on at
    Re: BUG ? Behavior differs between app preview and published app

    @R3dKap 

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard