web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / BUG: Can't start app b...
Power Apps
Answered

BUG: Can't start app because OnStart() code gets messed up in international setting (e. g. German)

(0) ShareShare
ReportReport
Posted on by 269

With the current version (3.19043.16), saving the app messes up the OnStart() code.

 

My code:

Set(MyUserId;Office365Users.MyProfile().Id);;
Set(HomeTimerStartTime;Now());;
Set(UTCNow;Today());;
Set(UTCNext;DateAdd(UTCNow;2;Days));;

When I save and reopen the app, the OnStart code has changed to:

Set(MyUserId;;Office365Users.MyProfile().Id);;;;
Set(HomeTimerStartTime;;Now());;;;
Set(UTCNow;;Today());;;;
Set(UTCNext;;DateAdd(UTCNow;;2;;Days));;;;

which prevents the app from starting.

 

Even if I try to change that to the US format:

Set(MyUserId,Office365Users.MyProfile().Id);
Set(HomeTimerStartTime,Now());
Set(UTCNow,Today());
Set(UTCNext,DateAdd(UTCNow,2,Days));

 It changes to

Set(MyUserId;Office365Users.MyProfile().Id);
Set(HomeTimerStartTime;Now());
Set(UTCNow;Today());
Set(UTCNext;DateAdd(UTCNow,2;Days));

which also doesn't "compile" due to missing semicolons at the end of the line (we need two in Germany). When I add the missing semicolons, the same automatic change as in the first two parts happens.

Categories:
I have the same question (0)
  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    I tried the same scenario, even a (very similar) expression, and couldn't reproduce your issue:

    Set(MyUserId;'Office365-Benutzer'.MyProfile().Id);;
    Set(HomeTimerStartTime;Now());;
    Set(UTCNow;Today());;
    Set(UTCNext;DateAdd(UTCNow;2;Days));;

    I was able to save an app with this expression on the OnStart. If you create a new app and have a similar expression, do you see the same issue, or does it happen with a specific app only?

    One thing you can try - removing the last ';;' from the expression, since there are no other statements after the line that sets the UTCNext variable. Can you let us know if this makes a difference?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @AlexN,

     

    It seems you've discovered the same kind of error I have. Only with the difference that it doesn't concern OnStart() in my case but a normal button.

    I am at least glad that I am not an individual case and hope that the bug will be fixed soon.

     

    Here is my topic: https://powerusers.microsoft.com/t5/General-Discussion/Faulty-saving-process/m-p/271554#M79365

  • AlexN Profile Picture
    269 on at

    Have the same problem with another app now. What both have in common: They are older apps that didn't have the separate OnStart() trigger nor the "App" part before. Both had the OnStart() trigger on the first form.

     

    When I start editing, the App "part" with the separate OnStart gets created, but completly messed up. Afterwards there is no way to repair, it always ends up messed up after loading the editor.

     

    Exporting the app as zip though shows, that the code is correct after export. So this must be some import problem.

  • Verified answer
    AlexN Profile Picture
    269 on at

    So, after a bit more digging into the code I found the error (or let's say the part that causes it).

    It's the ForAll() function (which I was using in my formula, but didn't provide in the sample codes above, shame on me.

     

    If I rework the code to omit using ForAll, everything is working again as expected.

     

    What's still broken is converting older apps to newer app structures. If you look into the file structure of an older exported *.msapp there are some differences to newer app versions. The automatic conversion which happens if you start editing an older app messes up some code by reverting code with double semicolons as "line ends" to single semicolons and changing semicolons to commas as parameter dividers.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard