Loading...

How to build a Power Apps progress bar component

How to build a Power Apps progress bar component

tl;dr

Components are reusable building blocks in Power Apps which increase maker productivity and design consistency. If you are new to them, you should definitely start to learn how to build them - This post will make it easier for you! This progress bar component showcases also custom properties to give you an idea on how you can make a component customizable to different needs.

Progress Bar component: the result

Let’s dive in head first and have a look how the completed components will look like. As I designed them to be adjustable to different designs, here is some inspiration:

Power Apps progress bar components

As you can see, the progress bars can have different widths and heights and can be horizontal or vertical. We will first tackle the horizontal one.

Build the component - horizontal

For this component, that I will name cmp_ProgressBar_hor, we only need two text labels, which you need to insert

  • lbl_BarCurrent, which shows the progress
  • lbl_barTotal, which shows the total

Create the custom properties

We will need a bunch of custom properties so the component is more flexible

  • barMaxValue (Number), set default to 100 - its the maximum value of the progress bar
  • barCurrentValue (Number), set the default gbl_barValue - this is the variable that controls how much progress is being made
  • barMaxFill (Color), I set the default to ColorValue("#1e6091") - it’s the fill color of the maximum value
  • barCurrentFill (Color), I set the default to ColorValue("#168aad") - it’s the fill color of the current value
  • barWidth (Number), I set the default to 200, it’s the width of the progress bar
  • barHeight (Number), I set the default to 42, its the height of the progress bar
  • labelColor (Color), I set the default to White, it’s the color of the label that shows the percentage of progress

custom properties overview

Set properties for the labels

For our lbl_BarCurrent:

  • Color: cmp_ProgressBar_hor.labelColor
  • Fill: cmp_ProgressBar_hor.barCurrentFill
  • Height: lbl_barTotal.Height
  • Text: RoundUp(100*(cmp_ProgressBar_hor.barCurrentValue/cmp_ProgressBar_hor.barMaxValue),0) & "%"
  • Width: lbl_barTotal.Width*cmp_ProgressBar_hor.barCurrentValue/cmp_ProgressBar_hor.barMaxValue
  • X: lbl_barTotal.X
  • Y: lbl_barTotal.Y

For our lbl_barTotal:

  • Fill: cmp_ProgressBar_hor.barMaxFill
  • Height : cmp_ProgressBar_hor.barHeight
  • Text: ""
  • Width: cmp_ProgressBar_hor.barWidth
  • X: 5
  • Y: 5

Now set the Width of the component to cmp_ProgressBar_hor.barWidth+10 and the Height to cmp_ProgressBar_hor.barHeight+10.

If you want to try out the component in your app, you will need to have something that will set the value of our variable gbl_barValue. You can do this with a slider control. Set the OnChange property to Set(gbl_barValue, Self.Value), move the slider and voila, your bar is making progress! You can now insert another component instance and play around with the custom properties and change height and width, the label color as well as the fill colors.

Build the component - vertical

If you now want to create the same component but vertical, you can duplicate the component and then we only need to adjust a few things. Name your vertical component cmp_ProgressBar_vert.

For our lbl_BarCurrent:

  • Color: cmp_ProgressBar_vert.labelColor
  • Fill: cmp_ProgressBar_vert.barCurrentFill
  • Height: lbl_barTotal.Height*cmp_ProgressBar_vert.barCurrentValue/cmp_ProgressBar_vert.barMaxValue
  • Text: RoundUp(100*(cmp_ProgressBar_vert.barCurrentValue/cmp_ProgressBar_vert.barMaxValue),0) & "%"
  • Width: lbl_barTotal.Width
  • Y: lbl_barTotal.Y+lbl_barTotal.Height-Self.Height

For our lbl_barTotal:

  • Fill: cmp_ProgressBar_vert.barMaxFill
  • Height: cmp_ProgressBar_vert.barHeight
  • Width: cmp_ProgressBar_vert.barWidth

How can we use this component in apps?

People like to know the answer to the question Are we there, yet?. Indicating their progress in long forms is a nice way to improve user experience and satisfaction, as people then know what to expect.

progress bars

Want to reverse-engineer? You can download the component library 🚀✨

Feedback and What’s next?

I would love to learn about your use cases. Where do you use progress bars or which other scenarios do you see for these bars? Let’s talk on twitter :-) If you found this blog post useful, please also subscribe to my newsletter - news coming about every 2 months, I promise to not spam you!

Published on:

Learn more
Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

You are holding GitHub Copilot Wrong!

Part 0 showed why constant prompting, re-prompting, and steering GitHub Copilot feels fragile. Not because Copilot is unreliable, but because ...

7 months ago

You are holding GitHub Copilot Wrong!

Most developers think that one can’t really use GitHub Copilot wrong. There is a chat interface that lets you also choose a model, so th...

7 months ago

Building a Multi-Hierarchy Ticket Classification System (Because Keywords Aren't Enough)

Look, I love a good keyword-based system as much as the next developer. They’re fast, predictable, and when your user says “VPN,&r...

8 months ago

Secretless cross-tenant dataverse access

Client secrets are like hiding your house key under the mat; easy to grab and impossible to audit. Certificates are just slightly better, beca...

9 months ago

How Azure CLI handles your tokens and what you might be ignoring

Running az login feels like magic. A browser pops up, you pick an account, and from then on, everything just works. No more passwords, no more...

9 months ago

How Dev Proxy teaches you to make your apps more resilient

I added Microsoft Dev Proxy to my Mermaid → Dataverse converter, because I wanted to test how it handled rate limits and API errors. What I go...

10 months ago

Building Azure functions that never store secrets — ever

What if your function could hit Microsoft Graph with no client secrets, no certs, and no Key Vault entries? That is exactly what a Managed id...

10 months ago

Introducing Mermaid to Dataverse Converter

Why diagrams matter (and why they usually fail us) Entity-Relationship Diagrams (ERDs) are the universal shorthand for talking about data mode...

11 months ago

It’s OK to be seen trying

It’s OK to be seen trying Somewhere along the way, we started believing that you’re only allowed to speak after you’ve figured everything out....

1 year ago

Stuck in pilot - Part 1: no foundations, no future

“We just need to test the AI. We’ll figure out the data later.” That sentence has quietly killed more AI pilots than any model failure ever ...

1 year ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy