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

Community site session details

Session Id : CEpSN4mWOgjs83JEmy8ZRI
Power Apps - Building Power Apps
Unanswered

FontWeight Semibold Variable

Like (0) ShareShare
ReportReport
Posted on 12 Oct 2019 17:33:58 by 68

Hi,

I am setting up a styling page in an app. I'm using variables to store styling values. So for example, I created a variable for font size called "FS" and set its value to "21".  Then when adding a label to a form, I set its "Size" property to "FS".  This works and sets the font size of the label to 21.

 

I'm doing the same thing for font weight. Variable is "FW".  I set its value to "Bold".  Then I set the label's "Font Weight" property to "FW" and the font shows in bold.

 

Problem is when I try to use "Semibold" as the "FW" value.  This just does not seem to work. The values "Normal", "Bold", and "Lighter" all seem to apply the proper weight to the label when I assign that to the "FW" variable. But not "Semibold".

 

Anyone have a clue as to how I can make this work?

 

Thanks,

David

I have the same question (0)
  • mdevaney Profile Picture
    29,987 Moderator on 17 Oct 2019 at 12:22:57
    Re: FontWeight Semibold Variable

    @Dpalmer 

    Have you tried applying the variable to FontWeight properties of objects?  I have done this and there is no issue.  Please test and let me know.

  • Dpalmer Profile Picture
    68 on 17 Oct 2019 at 03:10:41
    Re: FontWeight Semibold Variable

    Oh thanks!

     

    No the problem still exists. The variable is being set to "600" not "Sembold" so I assume when I apply that vairable to the FontWeight properties of objects, it doesn't know what to do.  


    David

  • mdevaney Profile Picture
    29,987 Moderator on 17 Oct 2019 at 00:36:12
    Re: FontWeight Semibold Variable

    @Dpalmer 

    Actually, you will be surprised to learn that this is completely normal Cat Surprised

     

    The FontWeight property accepts only Enum values in PowerApps (FontWeight.Bold, FontWeight.Normal, etc.).  But I know from studying the CSS (cascading style sheets) language is FontWeight is set by an integer value within a web-browser.  Here's the hidden values for each font weight.  I can't say why this value is Visible in the label (I tested this too) but that's just the way PowerApps was made.

     

    Normal: 400
    Semibold: 600
    Bold: 700

     

    That being said, were you able to resolve the initial problem? Cat Wink

     

  • Dpalmer Profile Picture
    68 on 17 Oct 2019 at 00:02:31
    Re: FontWeight Semibold Variable

    Thanks for the replies.  Still having an issue.  Thanks for the "Switch()" function tip!!

     

    I'm using a dropdown control.  Set the OnChange property to:

     

    Switch(
    Dropdown1_1.Selected.Value,
    "Bold", Set(LW, FontWeight.Bold),
    "Normal", Set(LW, FontWeight.Normal),
    "Semibold", Set(LW, FontWeight.Semibold)
    )

     

    What I noticed today is if I place a label on the form and assign its text value to "LW", the following is the results for each selection:

     

    Select "Bold" from dropdown, LW = "bold"

    Select "Normal" from dropdown, LW = "normal"

    Select "Semibold" from dropdown, LW = "600"

     

    So something very odd is happening here.

     

    Thanks,
    David

  • mdevaney Profile Picture
    29,987 Moderator on 15 Oct 2019 at 13:11:54
    Re: FontWeight Semibold Variable

    @v-yutliu-msft 

    I think this is the same suggestion as what I had proposed earlier, right?  Am I missing something here?

  • v-yutliu-msft Profile Picture
    on 15 Oct 2019 at 06:50:27
    Re: FontWeight Semibold Variable

    Hi @Dpalmer ,

    I've receviced reply.

    Since the value of setting the fontweight is enumeration type, not constant type, so please not use "Bold","Normal","Semibold" to set.

    The right format shouble be like: FontWeight.Bold,FontWeight.Normal, FontWeight.Semibold.

    To sum up, you should use these formulas to set your buttons:

    Set(var,FontWeight.Bold) //button1's OnSelect
    Set(var,FontWeight.Normal) //button2's OnSelect
    Set(var,FontWeight.Semibold) //button3's OnSelect

     

    Best regards,

  • v-yutliu-msft Profile Picture
    on 14 Oct 2019 at 10:06:20
    Re: FontWeight Semibold Variable

    Hi @Dpalmer ,

    Do you mean that you can not use a variable to change a label's fontweight to Semibold?

    I've made a similar test and found that what you talked about is true.

    Using variable to change a label's fontweight to normal or bold is ok, while Semibold is not ok.

    I've reported this issue to our product team.

    If there's any reply about this, I will leave my message here.

    Thanks for your feedback! 

     

     

    Best regards,

  • mdevaney Profile Picture
    29,987 Moderator on 12 Oct 2019 at 19:17:30
    Re: FontWeight Semibold Variable

    @Dpalmer 

    You need to remove the quotes in red from your code just like my example showed.  Your code looks like this...

     

    If(
    Dropdown1_1.Selected.Value = "Bold", Set(LW, "Bold"),
    If(Dropdown1_1.Selected.Value = "Normal", Set(LW, "Normal"), Set(LW, "Semibold"))
    )

     

    You might also like to use a SWITCH function for simplicity.

     

    Switch(
    Dropdown1_1.Selected.Value,
    "Bold", Set(LW, Bold),
    "Normal", Set(LW, Normal),
    "Semibold", Set(LW, Semibold)
    )

     

    Let me know your questions.

     

    ---
    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

  • Dpalmer Profile Picture
    68 on 12 Oct 2019 at 19:06:47
    Re: FontWeight Semibold Variable

    Thanks but I still have a problem.

     

    So the detail is that I'm trying to use a dropdown to select the font weight value.  The variable is "LW" and I'm using this formula in an OnChange property of the dropdown itself:

     

    If(Dropdown1_1.Selected.Value = "Bold", Set(LW, "Bold"), If(Dropdown1_1.Selected.Value = "Normal", Set(LW, "Normal"), Set(LW, "Semibold")))

     

    This works for Bold and Normal, but not for Semibold.  Even if I adjust the last "Set" statement to be "Set(LW, "FontWeight.Semibold")

  • mdevaney Profile Picture
    29,987 Moderator on 12 Oct 2019 at 17:39:26
    Re: FontWeight Semibold Variable

    @Dpalmer 

    This is what works for me...

     

    Set(FW,FontWeight.Semibold);

     

    If that does not work please share a screenshot of your code.

     

    ---
    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading started
Loading complete