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 / Adding a Component to ...
Power Apps
Answered

Adding a Component to OnStart

(0) ShareShare
ReportReport
Posted on by 1,302

Hi

 

I want to set the default Theme, Controls Theme and ControlsFontSize when the App Loads and I want a component which contains all of these items.

 

I then want to add this component to the OnStart Function.

 

But I cannot see how to do this.

 

Can anyone help ?

 

Regards

 

Nigel

Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @NigelP ,

     

    OnStart is a property of an app. You can't add a component to a property.

     

    Perhaps the below helps you in the right direction:

     

    https://www.youtube.com/watch?v=cuXTZ4-szrg

  • zmorek Profile Picture
    3,272 on at

    Here's another way to define a custom "theme" for each app:

     

    Create A Power Apps Custom Theme - Colors, Fonts, Icons & Controls (matthewdevaney.com)

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hey, I have done the work for you so that you don't have to spend time trying to figure this out - please feel free to use my template and modify it as you need 🙂

     

    https://bit.ly/BrandTemplateV3 

  • NPrice99 Profile Picture
    1,302 on at

    Hi @iAm_ManCat 

     

    I am already using your V3 template !  Does this mean I have to copy across everything in your App.OnStart into my new project.  I hoping I could componentise it and then just include the component in the App.OnStart, but the components are greyed out when i click on the "+" symbol in the left hand nav.

     

    Regards

     

    Nigel

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Nigel Price? Hey! Long time no see since Ignite/UserGroup before the pandemic started

     

    So the way to do it for existing apps is a bit more complicated if you want to enable these things by default as currently the only way to apply Proper defaults is to edit the json of the app (thanks MSFT for not getting to that sooner)

     

    Save your app locally, extract it, extract the themes .json from my app and stick it in the extracted folder for your app, use the build powershell script to rebuild your app folder into a .msapp (https://github.com/iAmManCat/PowerApps-Branding-Template/tree/master/V3 - can get it here), open your app from the editor by choosing the local file and then in your OnStart you'll need to add all of the themes etc stuff from my template's onStart.

     

    Until MSFT has a better way for us to do it, that's the only way unfortunately!

  • NPrice99 Profile Picture
    1,302 on at

    Hi @BCBuizer 

    The link is to April Dunham's branding video which uses the CoE Theme editor which, in turn, uses the Dataverse, which in turn means you ned a Per User licence.

     

    There does not seem to be a way to add a company's branding theme where you already know the RGBA numbers or the Pantone number.

     

    Regards

     

    Nigel

  • NPrice99 Profile Picture
    1,302 on at

    Hey

    How are you doing ?  Yes its been a long time.  Hopefully as things are getting back to normal we can bump into each other again.  So the only way to get a theme is to edit the json,  package the app again ?

     

    Regards

     

    Nigel

     

     

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes, if you want the controls to default that way - you could also set one up manually and change all of the controls manually but that seems like a pain to me when you have the themes.json option

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard