cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AlexN
Level 8

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
AlexN
Level 8

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

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.

4 REPLIES 4
PowerApps Staff CarlosFigueira
PowerApps Staff

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

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?

pasweh
Level: Powered On

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

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
Level 8

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

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.

AlexN
Level 8

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

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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 194 members 4,260 guests
Please welcome our newest community members: