Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Code doesn't execute outside the studio

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have piece of code that creates collection from filtered database and counts the rows to create count and percentage of employees working for each day of the week.

ClearCollect(CL_Percentages, Filter(Database_List, Week=ddWeekNo_Admin.SelectedText.Value, If(ddDepartment.SelectedText.Value = "All", true, Department.Value = ddDepartment.SelectedText.Value)));

Set(Total, CountRows(CL_Percentages));

Set(MonCount, CountRows(Filter(CL_Percentages, Monday.Value="Working")));
Set(MonProc,Round(MonCount/Total*100,1));

 

The code continues for all days of the week. I have this code in three places:

  • "ddWeekNo_Admin" dropdown in OnChange;
  • "ddDepartment" dropdown in OnChange;
  • "Admin_Menu", the screen where it all takes place in OnVisible

If you change one of the dropdowns the code executes without an issue, everything is calculated. However the Admin_Menu part, where the code was supposed to be ran for the first time just refuses to work. I even tried applying this code to other controls such as on App OnLaunch, the button leading to that screen and a timer with 1s delay after showing that screen.

This issue appears when using the app on phone. Other users also reported it happening on their PCs.

  • Re: Code doesn't execute outside the studio

    That worked, thanks.

    Apologies for not trying this and coming straight to conclusion.

  • v-siky-msft Profile Picture
    v-siky-msft on at
    Re: Code doesn't execute outside the studio

    Hi @Anonymous ,

     

    Regardless of devices, the Apps always run in the PowerApps studio.

    Does that above workaround make sense for your case?

    Sik

  • Re: Code doesn't execute outside the studio

    I mean that the code doesn't execute specificaly outside the App Studio.

     

    App Studio has no issues and code works perfectly. However if I run the app through my phone or MS Teams it fails.

  • Verified answer
    v-siky-msft Profile Picture
    v-siky-msft on at
    Re: Code doesn't execute outside the studio

    Hi @Anonymous ,

     

    Do you mean the codes can't be triggered properly in Screen.OnVisible property and App.OnStart property?

    In this case, I prefer the issue is caused by Preview Features and Experimental Features Setting in App Studio.

    Please try to toggle off all experimental feature and the following Preview features that may cause this issue.

    Snipaste_2020-09-03_14-50-35.png

    Hope this helps.

    Sik

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard