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 / Search for a number wi...
Power Apps
Answered

Search for a number within a label?

(0) ShareShare
ReportReport
Posted on by 1,855

Scenario:

  • Gallery with a multiline label (lblDuration)
  • Sample lblDuration text:
    • "This REST service took 50 seconds to execute."
  • I'd like to set lblDuration Fill based on the number found in the text
  • Something like: If(Find(lblDuration, > Value("10")), Red, LightGray)
    • Which would highlight lblDuration if there is a number greater than 10 found in the text.

The above sample using Find() doesn't work. Neither does Search().
Any other ideas?
THank you!

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Will the number always be at a fixed spot? In other words, is the format of that text well defined? Or could the number be anywhere in the string?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • seadude Profile Picture
    1,855 on at

    Hello @PowerAddict , I appreciate your quick response. The answer is no, the content is not structured in a way to utilize string manipulation.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    No problem. One more question: is there an expected range of values e.g. max will be 99?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Here you go:

    Set the fill property to something like this:

    If(Value(Match(Label28.Text, "\d+").FullMatch)>10, Red, RGBA(0, 0, 0, 0))

    Label28 is where my text is. I used your example: This REST service took 50 seconds to execute. You can replace Label28 with your label or wherever the text is. Also, I used Red or No Fill. You can replace RGBA(0,0,0,0) with Gray.

    Let me know if this works.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    A quick demo:

    Format.gif

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com

  • seadude Profile Picture
    1,855 on at

    Hi @PowerAddict . Thank you.

    I see the solution working in your demo, however porting it to my application doesn't seem to work.

    lblGalDuration is the label in the gallery. As you can see, it holds a value of "0.25" in the label. I've lowered the value in the function to "0.1" but it does not trigger...

     

    image.png

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    No problem.

    Two questions:
    1. Is lblGalDuration where your text is stored? Is it multi-line text? HTML text?
    2. If you just put this expression in a label, what do you see?

    Match(lblGalDuration.Text, "\d+").FullMatch

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Also, your original post did not specify that the numbers will be in decimals. Will they always be in decimals or can they be in either format?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com
  • seadude Profile Picture
    1,855 on at

    1. Yes, lblGalDuration is where my text is stored. It is a multi-line label.

      a. I just changed the value to a whole number, 3. It flagged the "10.9" value, but not the "3.7" value.

      b. image.png

    2. Placing Match(lblGalDuration.Text, "\d+").FullMatch in a label shows nothing, just blank.

    image.png

    3. Numbers may be whole or decimal.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Is there a max number of digits after the decimal?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard