Horizontal Text alignment of Toggle control in Power Apps canvas apps

I am back with another quick tip for Canvas apps and this time it’s related to text alignment of Toggle control in canvas apps.

We all love toggle controls. And if you worked with Canvas apps you know that any boolean field will display as toggle control.

I have inserted a Toogle control on the form. Below is Toggle text when the Toggle value is False.

Text alignment of Toggle control in Power Apps Canvas apps

And below is the Toggle text when the Toggle value is True.

Text alignment of Toggle control in Power Apps Canvas apps

Now the problem is obvious. If you see the text alignment, the Small Text is appearing on the extreme right which is kind of awkward in terms of UI.

Now the obvious thing is to change the horizontal alignment of the text. But unfortunately there is no way you can do that for now. So let’s see how it can be handled.

The first thing is to set the Show Label property of the Toggle control to false.

Text alignment of Toggle control in Power Apps Canvas apps

The next thing to do is to insert a label to show the text information. Stretch it to the max length to accommodate the longest text.

Text alignment of Toggle control in Power Apps Canvas apps

Set the Text property of the label to the below formula. In my case the name of the control is Toggle1. You may need to change the name of the control in formula.

Text alignment of Toggle control in Power Apps Canvas apps

Below is the final behavior of the control in action.

Hope this helped!

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading