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 / Whole number input is ...
Power Apps
Unanswered

Whole number input is not available

(0) ShareShare
ReportReport
Posted on by 91

I would like to add an input filed which accepts only whole number.

 

Although the documentation provides that I could use "Format" property, there is no "Format" property for the input field. control-text-input 

 

Format â€“ Whether the user input is restricted to numbers only or can be any text.

 

Currently, I check validation onChange. But I just want to know that is there any way rather than checking validation.

 

ynaing_0-1676605738164.png

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @ynaing,

    Here is the thing, if you want to force the whole number input, you must have validation on it because only the changes the TextInput made could be validated if it is whole number or not. 

    OnChange validation is necessary if you want to input whole number.

     

    Further, the control you posted is not a TextInput, this validation must heppen on a TextInput.

     

    If you have a text input control, set the OnChange property as below:

    If(TextInput1.Text <> "" And
     Value(TextInput1.Text) <> RoundDown(Value(TextInput1.Text),0),
     Notify("Not a whole number");
     Reset(TextInput1)
    )
  • ynaing Profile Picture
    91 on at

    Hi @v-qiaqi-msft

    Thanks for your reply.

     

    I found that there are 2 separate controls. "Text Input" and "Text Box"

    They are not same.

    But in the same power apps screen, I have used "Text Box" which already has whole number input.

    Later I can't use "Text Input" and there is only "Text Box".

     

    With "Text Box" I cannot change the border color when validation fail.

    Using "Reset" is ok for new form, but not appropriate in edit mode.

     

    Currently I copy the previous "Text Input" and paste everywhere I want to use it.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @ynaing,

    Could you please show me your app configuration?

     

    I guess the your mentioned "Text Box" is the Label control. You are right, Text Box and Text Input are totally different control, Label is used to display string and you could not input anything there. However TextInput control could input.

     

    Here is the thing, the Reset feature works only for a TextInput, it could be reset in new mode as well as edit mode, but you should set it within the OnChange property of the Text Input control.

     

    I strongly suggest you use a TextInput control to validate the number input because it is much more efficient.

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard