Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Variables in App OnStart stopped working

    Posted May 12, 2022 02:51 PM
    Edited by Lisa White May 12, 2022 02:54 PM
    I've been setting global variables (see examples below) in App OnStart for years. Yesterday (5/11/22), the variables stopped working in a new Power App that I'm developing. The variables still work in currently deployed apps - I'm afraid to edit any of them for fear the variables will break.

    I've saved and published the app multiple times, closed and restarted Power Apps multiple times, rebooted, tried running vs. editing the Power App, and beseeched the Technology Gods to help me.

    Is anyone else experiencing this issue?

    Sample variables on App OnStart:

    Set(
    varAppVersion,
    "V0.001.00 4/18/2022"
    );

    Set(
    varCurrentUser,
    User()
    );

    Set(
    varManager,
    Office365Users.Manager(User().Email).Mail);

    Set(
    varDepartment,
    Office365Users.UserProfileV2(User().Email).department;


    ------------------------------
    Lisa White
    Senior IT Specialist
    Herndon VA
    703-709-7172
    ------------------------------


  • 2.  RE: Variables in App OnStart stopped working

    Posted May 13, 2022 08:16 AM
    Edited by Ed Bellman May 13, 2022 08:19 AM
    Can you confirm that File > Settings > General > Enable App.OnStart property is turned On?

    I know they blocked Navigate() in OnStart but everything else should still be okay.

    Thanks, Ed

    ------------------------------
    Ed Bellman
    Principal Consultant
    P3 Adaptive
    Fairborn, OH
    ed.bellman@outlook.com
    ------------------------------



  • 3.  RE: Variables in App OnStart stopped working

    Posted May 16, 2022 03:02 PM
    Hi Ed,

    Yes, Enable App.OnStart is turned on. And, even more mysteriously, it started working the next day. I'm guessing someone fed the hamster.

    I'm looking at the "declarative" method to set variables in the App.StartScreen. Planning to test them on a sandbox Power App.

    https://powerapps.microsoft.com/en-us/blog/app-startscreen-a-new-declarative-alternative-to-navigate-in-app-onstart/

    Thanks for your help.



    ------------------------------
    Lisa White
    Senior IT Specialist
    Herndon VA
    703-709-7172
    ------------------------------