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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OnStart code efficienc...
Power Apps
Unanswered

OnStart code efficiency review

(0) ShareShare
ReportReport
Posted on by 364

Morning all,

 

I was hoping to check if this is the best way I could be running this OnStart code to speed up the load of my app:

 

 

//Icon table for SVG icons
Set(Icons, IconTable);

Concurrent(

//Variables to be reset
Set(suggested, Blank()),
Set(glossarySortOrder, Blank()),
Set(areaCat, Blank()),
Set(selectedItem, false),
Set(glossary, false),
Set(infoPane, false),

//SVG Icons
Set(pbiIcon, LookUp(Icons, "pbiIcon" in IconName, IconLink)),
Set(updateIcon, LookUp(Icons, "updateIcon" in IconName, IconLink)),
Set(mailIcon, LookUp(Icons, "mailIcon" in IconName, IconLink)),
Set(pageIcon, LookUp(Icons, "pageIcon" in IconName, IconLink)),
Set(staffIcon, LookUp(Icons, "staffIcon" in IconName, IconLink)),
Set(saveIcon, LookUp(Icons, "saveIcon" in IconName, IconLink)),
Set(homeIcon, LookUp(Icons, "homeIcon" in IconName, IconLink)),
Set(downIcon, LookUp(Icons, "downIcon" in IconName, IconLink)),

//Colour palette
Set(skyBlue, ColorValue("#0079BB")),
Set(lightBlue1, ColorValue("#CCE7F6")),
Set(bgBlue, RGBA(241,244, 249, 0.8)),
Set(itemGrey, ColorValue("#D6DFEE")),
Set(bgGrey, RGBA(167, 182, 203, 0.56)),
Set(headerBlue, RGBA(0, 121, 187, 0.81)),

//Alphabet table for Glossary
Set(alph, AlphTable),

//Area Filter table
ClearCollect(
 areaFilters, 
 {Area: "Home"},
 {Area: "Staff"}, 
 {Area: "Students"}, 
 {Area: "Report"}, 
 {Area: "Page"},
 {Area: "Add Item"}),

//FAQ Dataset
ClearCollect(
 faqCol,
 Filter(
 'FAQ Dataset',
 Status.Value = "Active")),

//Items updating soonest
Set(
 calendarCol,
 FirstN(
 AddColumns(
 Filter(
 GroupBy(
 SortByColumns(
 Filter(
 AddColumns(
 Calendar,
 "_FAQname", 'FAQ Item Name'.Value
 ), Month >= Today()),
 "Month", Ascending
 ),
 "_FAQname",
 "FAQs"
 ),
 !IsBlank(_FAQname)
 ),
 "MostRecent", First(FAQs).Month,
 "Details", First(FAQs).Name1
),
3
)));

//Attachments Collection
ClearCollect(preImageCol, 0);
ClearCollect(
 imageCol,
 Filter(
 Ungroup(
 ForAll(
 Sequence(
 CountRows(faqCol)),
 Collect(
 Test,
 Last(Test).Value+1);
 {
 Image:Last(FirstN('FAQ Dataset',Last(Test).Value)).Attachments,
 ID:Last(FirstN('FAQ Dataset',Value)).ID
 }),
 "Image"),
 !IsBlank(Id)))

 

 

For info, the Alph and Icon collections are drawn from Excel tables uploaded as static tables to reduce the load on the App and to remove ghastl

 

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard