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 / Handling the number bl...
Power Apps
Answered

Handling the number blanking issue

(0) ShareShare
ReportReport
Posted on by 83

I've recently come across the number blanking issue (and don't want to have to go and make all my number columns back to text). What I have discussed is that if the number value field is changed and it is blank then can I default it to 0. So it becomes an issue when the user enters a number but then goes back edits it and "clears" it -> clicks save then the number will just remain. 

 

Looking at using the OnChange for the text box to do something like this 

 

If(IsBlank(txtStandbyDays),txtStandbyDays.Text=0)

 

But it doesn't work. I guess I could create a context value for each field but there are ALOT of fields and do it that way? 

 

Or just put a disclaimer on each numeric field.. 

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Andrew260z1 

     

    Can you try to set the configuration as:

     

    TextInput1 -> Default -> 0

    TextInput1 -> OnChange -> If(IsBlank(TextInput1.Text),Reset(TextInput1))

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

    Hi@Andrew260z1,

    Based on the issue that you mentioned, do you want to set the TextInput to "0" when you clear it?

    Confirm that if you edit a TextInput and clear the number within means that you want to populate the TextInput with the "0" value.

    Could you please share a bit more about your scenario,:

    1. How you set the Default property of the TextInput?
    2. Do you have this TextInput within an EditForm?

    If it is in an EditForm, set the Update property of the data card corresponding to the TextInput control as below:

     

    If(IsBlank(txtStandbyDays.Text),"0",txtStandbyDays.Text)

     

    Set the Default property of the TextInput as below:

     

    ThisItem.ColumnName

     

    If it is a single TextInput, it depends on how you set the Default property of the TextInput. You can refer to @yashag2255 's solution.

    You could set the Default property of the TextInput as below:

     

    "0"

     

    Set the OnChange property of the TextInput as below:

     

    If(IsBlank(txtStandbyDays.Text),Reset(txtStandbyDays))

     

    Best Regards,

    Qi

     

  • Andrew260z1 Profile Picture
    83 on at

    Thanks the response. I ended up resetting to the current value on change so they can at least see the number was not cleared when they clicked off. I didn't want to default everything to 0 by default. And have put a message on the form as well. Hopefully that will sort it out 

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 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard