Power Apps Branding Template V3

You may also like...

59 Responses

  1. David says:

    Thank you for creating such an amazing time saver for all of us. You are my Hero!

    I have the following issue:
    I have created a new screen named “Log”.
    Then copied some controls from the “Theme Palette”.
    Controls in the new screen reference “ChosenControlsTheme”, e.g. “ChosenControlsTheme.AttachmentHoverColor”,
    “ChosenControlsTheme.EditFormFill”.

    All the colors are black in “Log”, if I don’t go to the “Theme Palette” and select item from the “glr_PaletteChoice_TP” such as “Microsoft Blue Light Theme” for example.

    Can I have a preselected theme, and not have black controls somehow?
    I am correct assuming that I can copy controls from “Theme Palette” and use them on my new screens?

    Thank you again for being awesome!

    Have a great day!

    • iAm_ManCat says:

      Hi!

      You don’t need to copy controls – you can insert controls using the normal ‘insert’ function and those controls will have the theming applied to them automatically – that’s the whole beauty of this template is that it themes the default controls.

      The controls on the Theme palette screen are modified to only work on the them palette screen as they need to have multiple themes applied from the gallery whereas everywhere else in the app it uses only one theme, sorry for any confusion here ๐Ÿ™‚ This would be why they show up black, as they can’t find the item to reference as they are no longer in the gallery.

      Cheers,
      Sancho

  2. Dzhyuneit says:

    Hello Sancho,
    Thank you for creating this great tool for all of us.
    I am wondering about Loading Screen.
    I have set a variable on Loading Screen.tmr_LoadingAction_LS.OnStart:
    Set(defaultRun, Text(Today(), “mmmm yyyy”));

    When I use it on Home screen defaultRun is blank.
    Should we use Loading Screen.tmr_LoadingAction_LS.OnStart to create such variables, or we should do it elsewhere?

    Best Regards,
    Dzhyuneit.

    • iAm_ManCat says:

      Hi,

      I think that may be the timer is not running? Timers in Power Apps only run when in play mode, so you have to either use the Play button in the editor or run the app separately to test timers.

      In this example, I would just put that code in the Loading Screen.OnVisible as it has no reliance on any datasources and will complete immediately ๐Ÿ™‚

      Cheers,
      Sancho

  3. David says:

    Thank you for creating such an amazing time saver for all of us. You are my Hero!

    I have the following issue:
    I have created a new screen named “Log”.
    Then copied some controls from the “Theme Palette”.
    Controls in the new screen reference “ChosenControlsTheme”, e.g. “ChosenControlsTheme.AttachmentHoverColor”,
    “ChosenControlsTheme.EditFormFill”.

    All the colors are black in “Log”, if I don’t go to the “Theme Palette” and select item from the “glr_PaletteChoice_TP” such as “Microsoft Blue Light Theme” for example.

    Can I have a preselected theme, and not have black controls somehow?
    I am correct assuming that I can copy controls from “Theme Palette” and use them on my new screens?

    I use V3.

    Thank you again for being awesome!

    Have a great day!

  4. Katie says:

    Oh my goodness! I have never been more excited to start a new PowerApps project than I am right now! Just downloaded your theme. Love all the context and advice included with your code! You’re my hero. ๐Ÿ˜‰ P.S., big shoutout for the accessibility/inclusivity piece.

    • iAm_ManCat says:

      Thanks so much, I really appreciate the sentiment – yes I tried to include as much help inside the file as I could! The accessibility available in the template should be something that’s available natively in the product, so until it is I hope everyone implements things like this in their Apps or at least tries to make their apps more accessible and inclusive ๐Ÿ™‚

  5. Amal says:

    How can i add to this? As in i want to add select properties like border thickness etc. Just a handful of properties.

    I tried just adding those to the onstart code and it does not work. Anything I need to do?

    • iAm_ManCat says:

      Hi Amal,

      You would need to add those properties yourself to each applicable control and either set them staticly in the Themes.json file, or set them to a variable in the Themes.json and then set those during app onstart. If you extract the msapp file, you can look at the Themes.json file inside it. I have some brief instructions on how to do that in the linked page within the “How do you use this section”.

      The reason I didn’t include borderthickness, was that once you reach a certain number of referenced values/properties, they cause excessive delays due to lookups to variables – this may no longer be the case as it was two years ago that it was an issue, so you are welcome to try adding those yourself.
      Cheers,
      Sancho

  6. Valentine says:

    Hello,
    thanks a lot for this, it’s will be a lot easier to design an app.
    I have a question, if I want to update your msapp with my color theme info, which files do I need to edit ? I exported the msapp with 7zip, and I have all thoses json files:
    – checksum
    – ComponentsMetadata
    – Header
    – Properties
    And these folders with json files as well :
    – Reference (DataSources.json; Resources.json; Templates.json; Themes.json)
    – Controls (12 files with number as name)
    – Components
    Do I need to edit all of theme ?
    Thank you ๐Ÿ™‚

    • iAm_ManCat says:

      Hi,

      The base colours are all defined in the app via variable during the OnStart process, there are almost none defined in the Themes.json as that was all edited to point towards variables. If you need to add your own theme, there is a section in the OnStart where themes are defined, or you can assign the particular colours for each property in there as well – there are example themes there with overrides as well – these overrides would override the default properties that are set during this App OnStart.

      Cheers,
      Sancho

  7. Ingve Fosse says:

    Hi Sancho!
    First off, great content on your blog! I really appreciate it.
    I read this entire post and downloaded the solution and tried it, it works great. For my use case I would like a single button (like the “Set theme” button) that sets ONE predefined theme. So that my team can copy the button into their apps, click it and it applies the theme.
    Do you think this is possible?

  8. Petra says:

    I would like to use your solution, but when I try to open the file (iAm_ManCat Branding Template V3.msapp) in PowerApps, I always just get an error message that something went wrong. I also tried in the Microsoft Developer environment, but no chance.
    Do you have a tip what else I can try?

    • iAm_ManCat says:

      Hi Petra,

      Are you trying to Open it or are you trying to Import it? This file is for opening, not for import.
      You will need to go into the editor, and click Open from inside there, using the “…” menu at the top of the editor.
      If you’re still having issues doing it that way, could you let me know if you are able to download (not export) one of your own apps and Open it in the same way? I have seen from others that some tenants like GCC are preventing Open of solutions altogether.

      Cheers,
      Sancho

      • Petra says:

        Hello Sancho
        Thank you very much for your reply.
        Meanwhile I found out that my business laptop caused the problem. It’s quite secured and the opening of locally saved apps is blocked. With my personal laptop I could open the app without any problems.
        I think it’s great what you have developed. This will make my custom design work so much easier.
        Regards
        Petra

  9. Darren says:

    Are there any legal restrictions on using the template? Is it considered open source? Thanks!

    • iAm_ManCat says:

      No Legal restrictions – I made this for people to use, build upon and share. Would be nice if you kept my name in a comment somewhere inside whatever you build, but it’s not a requirement ๐Ÿ™‚

  10. Kaly says:

    Hello Sancho, thank you for this wonderfull work !
    I have a question, when i add a new button control, it comme all default value like “ChosenControlsTheme.ButtonColor”, but when i add a new gallery, it is not the case, the font size, font color, etc. are not the dafeult.
    Did you not configure all those properties or i have a problem ?
    Thank you in advance for your help

    • iAm_ManCat says:

      Hi Kaly,

      The problem here is that Microsoft updated the galleries in Power Apps a few weeks ago, which broke all of the defaults code as they overwrote this.

      I will try get a new version out with fixes as soon as I can,

      Cheers,
      Sancho

      • Selin says:

        Hello Sancho,
        i was wondering why it didn’t work. I thought i had a problem! Thank you for explaining it!
        Thank you for this solution!
        Best regards,
        Selin

  11. Fritz Lenker says:

    After years in a MS web development environment where HTML and CSS are common whatever the language, you have brought design sanity to PowerApps. Thank you! I learned of you from my Matthew Devaney blog and have been experimenting with my own Power Apps using your Theme framework and have been amazed at the ease of bringing complex theming to them. However, a question: Can one have individual fonts and text sizes for each theme? I’ve tried it and get lots of errors. Thank you.

    • Fritz Lenker says:

      Never mind. After reading the entire app.OnStart text, the answer is clear, especially after looking at the Garish Control-level Test.

      • iAm_ManCat says:

        Hey Fritz,

        I’ve just seen these comments, Thanks for the compliment regarding design of Power Apps ๐Ÿ™‚ Glad you found what you needed in the OnStart – the garish example showed how to do the individual overrides but I guess I also could have done more tutorials etc for using this but struggled to find the energy to so tried to contain as much of the information inside the App itself to keep it self-contained.

        Thanks again!
        Cheers,
        Sancho

  12. Brian says:

    Should this work in the GCC environments as well? I keep getting “There was an error opening the file.” with simply a session ID

    • iAm_ManCat says:

      Hi Brian,

      I’m not able to answer that – the GCC docs don’t mention anything about the ability to open Apps, but I would suspect it has to do with data concerns and importing data that shouldn’t be allowed via an app. I don’t have access to any GCC tenants so can’t test it myself, but I would try and see if you can Save As/Open a blank app, and if you can export/import an app – if you can export/import but not open/save as then I could make you an importable copy to use

      Cheers,
      Sancho

  13. Daniel says:

    Hi!

    Great template for ensuring a organizational design across apps.

    Have you found a method to similarly apply this to any behavior/action properties of the controls? Such as OnSelect, OnChange etc. ๐Ÿ™‚

    • iAm_ManCat says:

      Hey Daniel!

      I certainly tried, many times, but sadly no – there’s no way to default the behaviour/action properties – the IDE only picks up defaults from the themes.json file so there’s only UI info in there, the rest is defaulted by using the IDE itself rather than entries in the msapp (for the record, they are in there, it just doesn’t read them as defaults to be used).

      Cheers,
      Sancho

      • Daniel says:

        Hi Sancho,

        Aww, to bad. Perhaps one day in the future…

        Another question then ๐Ÿ™‚ I was messing around with the Templates.Json to see what could be achieved with this. I had the idea that it would be nice with two different type of buttons, a primary button with a filled design and a secondary button with a outline design.

        I managed to create an additional button that could be used in the app, but I might have broken some referencing somewhere, because the coloring/design did not come out as intended.

        Have you tried something similar? If so, any success with it so far?

        Best,
        Daniel

        • iAm_ManCat says:

          I have also tried creating additional styles for buttons and other objects, but the Power Apps editor doesn’t pick these up correctly and from what I can see there’s a server-side template that it looks at for the controls it can interpret, so yeah I didn’t have any luck with that either unfortunately.

  14. Michael Demster says:

    Great Template. I have been promoting this with my customers. I haven’t seen anything else quite this nice.

  15. Deval says:

    Thank you very much Sancho for this brilliant template.
    Need your help for one thing, I was trying to apply one theme to my already existing app.
    I downloaded msapp file, unpacked it using vs code extension for power platform, changed the entire content of Theme.JSON file with one new app that uses this template, then used the powershell to convert the main app into zip and tried to import it, but I am getting error and it does not get imported successfully.

    Am I doing something wrong here?
    Would it be possible for you to brief me about how we can apply the themes to existing app please?

    Many Thanks in Advance! ๐Ÿ™‚

    • Deval says:

      PS: The App OnStart code is already there for initialisation of Theme, I just removed not requried items from Themes collection and copy pasted other stuff as it is from new app to main app’s OnStart, so both are same at the moment.

    • iAm_ManCat says:

      Hi Deval – The PowerShell script creates a .msapp formatted file rather than a .zip (the msapp is an archive, but its treated differently, so if you renamed it to zip then that won’t work), so if you have tried to import that then it won’t work as its not designed to be imported – you will need to use File > Open from within the Power Apps Studio to open the file and it must be the .msapp format ๐Ÿ™‚

  16. Tony says:

    Thank You for the hard work and for sharing it with the community. I’m new to the Platform. I have downloaded the .msapp and when I try and upload the app it continually fails ” Wrong Format expected .zip”. I’ve used the PowerShell script to create the zip file by commenting out the rename App portion. A little guidance would be greatly appreciated.

    • iAm_ManCat says:

      Hi Tony,

      This is a .msapp file so you don’t need to convert or change it into anything – the PowerShell script is for if you have extracted the .msapp into a folder to make changes to the underlying files and need to recombine it back into an msapp file, it is not designed to create .zip files, it creates an archive yes, but .msapp files are archives containing Power Apps canvas App data.

      It looks like you tried to import it rather than open it – You can open any .msapp file within Power Apps Studio by going to ‘File > Open > Browse ‘ – the quickest way is to create a blank app, then once the editor loads, click File> Open> Browse

      Cheers,
      Sancho

  17. Muhammad Usman Azmat says:

    Thank you for creating such a wonderful template and saving us from spending countless hours in UI designing. May be i am getting greedy but no harm in asking :), any plan to make this template responsive?
    May i know how i can apply background color to horizontal / vertical containers?

    • iAm_ManCat says:

      Hi Muhammad,

      Unfortunately we are limited by what controls the Power Apps team use in their themes.json for defaults, and containers are not included in this at present.

      Cheers,
      Sancho

  18. Ross says:

    Hello,

    I would like to take the time and thank you for creating this. Saves a ridiculous amount of time.

    • iAm_ManCat says:

      Thank you for saying that – I really do appreciate it. I spent a lot of time working on this so that others don’t have to spend that same amount of time! ๐Ÿ™‚

      • Ross says:

        On the OnStart section to set the themed Font, how would I use a proprietary font? Currently in PowerApps, I would type the name in double quotes in the Font property of a control.

        Thank you.

  19. Muhammed says:

    How could I go about setting more defaults? I want to set a default screen background image, and I want to change label colors in forms so that it is different depending on whether it is an edit form or a view form. Thanks

    • iAm_ManCat says:

      Hi Muhammed, unfortunately we can only work with what properties are exposed in the themes.JSON file – background colour is a default property of a screen so can be modified, but an image is not currently supported (even in the editor – you can’t change the background to an image, you have to insert an image and make it the size of the screen, so we can’t affect that by default). The forms use the same types of label types within them, so I don’t think its possible to change them contextually like you are asking. We are unfortunately limited by the properties and objects exposed by the Power Apps team. I do hope that they allow us to customize further in future!

      • Amal says:

        Hi Sancho, once again thanks so much for creating this. Where can i take a look at the JSON file?
        Is borderthickness a property mentioned in it? OR have you covered everything part of the JSON?

        • iAm_ManCat says:

          If you extract the msapp file, you can look at the Themes.json file inside it. I have some brief instructions on how to do that in the linked page within the “How do you use this section”

  20. Mark says:

    Hi Sancho – this is great! Is it possible to configure other properties not explicitly called out already in the control level properties, for instance margins and padding? Many thanks!

    • iAm_ManCat says:

      Hi Mark, yes it is – however the number of additional properties to do so resulted in an extra 125+ properties that need to be set and referenced, and this came at a slight performance hit so I’ve not included those.

  21. Vincent says:

    Hello,
    Great work !
    I the template the properties
    ControlsTheme.ButtonRadiusTopLeft
    ControlsTheme.ButtonRadiusTopRight
    ControlsTheme.ButtonRadiusBottomLeft
    ControlsTheme.ButtonRadiusBottomRight
    were missing. So I just added it and it works.

    I embed all of this in a Component Library. Seems working but I have to test it deeply.

  22. Reiner Knudsen says:

    I have a question. Going through the themes.json there are a lot of “style” definitions. There are multiple for labels and buttons etc. Where do they come into the game? How does one reference one of these styles? Or are they styles PowerApps automatically applies when creating a label in a certain context?

    • iAm_ManCat says:

      You are correct – Power Apps uses these when creating the Insert>New Screen templated controls for each screen – there is currently no way to insert or reference these unfortunately as you can only insert the default type of control – this is a limit imposed by the IDE itself. If you find a way to reference them please let me know!

  23. Stuart says:

    Hi. Can you please describe how I can add / import these into an existing Power App?

    • Reiner Knudsen says:

      This template is based on a manipulated .json file in the .msapp file. It is a bit of a hassle to change files within the .msapp file. You could add your app to Github and swap the themes.json file. Not sure whether that would do the trick, though.

  24. Reiner Knudsen says:

    Such an incredible effort. Thank you for sharing. That really saves time!!
    I have a question: How would I set all labels to bold font weight. Is that possible?

  25. Bob Cobra says:

    Thanks for the template! One question: Every time I run the app i get a divide by zero error on first load. Any ideas?

    • iAm_ManCat says:

      Hi Bob, there is a divide by zero issue whereby Power Apps is looking at a value before a Countrows() action has completed, which results in the rows equating to zero which it then divides by – I should have resolved this in a recent release so please try download it again.

  26. Ramesh Mukka says:

    After reading through the post, it definitely helps to bring this branding template to my apps. However I will be much interested if we have videos demonstrating about creating new themes out of this and/ or modify existing variables/collections too. This can give more visual appeal of how to use it. I am sure am coming back to read this again until I make best use of this. So should have so much effort for all 3 versions. All I can is Thank you so much giving so much to the community and am running short of words. ๐Ÿ™‚

  27. Valerie Schaffer says:

    Thank you, thank you, thank you! I’m spending today to look through this and make it my default branding app by adding all my components and our organization’s colors to it. Love the new home screen choices.

Leave a Reply

Your email address will not be published. Required fields are marked *