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 / Negative number valida...
Power Apps
Answered

Negative number validation not working in Text input number format

(0) ShareShare
ReportReport
Posted on by 603
I have a powerapps new form with negative number validation implemented in OnChange(). TextInput is set to number format.
 
However it works intermittently. I am still able to key in negative number and submit.
 
May i know what's the problem here?
 
TextInput OnChange
If(
    Value(Self.Text) < 0 || Find(
        "%",
        Self.Text
    ) > 0 || Value(Self.Text) <> RoundDown(
        Value(Self.Text),
        0
    ),
    Set(
        showcriticalval,
        true
    ),
    Set(
        showcriticalval,
        false
    )
)
 
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at
    Hi @Iantaylor2050​​​​​​​
    I suspect it is because rounding down a negative number actually rounds it up - try this
    Set(
       showcriticalval,
       Value(Self.Text) < 0 || 
       Find(
          "%",
          Self.Text
       ) > 0 || 
       Value(Abs(Self.Text)) <> 
       RoundDown(
          Value(Abs(Self.Text)),
          0
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard