Skip to main content

Notifications

Community site session details

Community site session details

Session Id : avyjZxVslfXzSgIitWps3X
Power Apps - Building Power Apps
Answered

How to check if the Text field is blank

Like (1) ShareShare
ReportReport
Posted on 4 Aug 2024 13:12:31 by 22
I am using the below code click button to patch only if the fields are Not blank.
But the every first time, even the field not blank, it bring notification. In the second click it works.
Could not understand, what is the reason.
 
Is there any other way to Test the blank fields, should I used the function Blank(TextBox2_1.Value)
please guide
 
Below is my code
 
If(Len(TextBox2_1.Value) = 0 || Len(TextBox2_12.Value) = 0 || Len(TextBox2_20.Value) = 0,
Notify("Cannot Save !!!  As  Form No, Model, Serial No  Fields Cannot be Blank", NotificationType.Warning,3000),
Patch(
TableMachRemarks,
  • Verified answer
    WarrenBelz Profile Picture
    147,337 Most Valuable Professional on 05 Aug 2024 at 00:40:13
    How to check if the Text field is blank
    Len() is actually the better option is it covers both Blank(() and Empty() - a text box can contain an empty string. I think your issue is actually the modern control - to test this, try Classic Text Inputs and see if that works.

    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

  • Suggested answer
    CU04081342-0 Profile Picture
    6 on 04 Aug 2024 at 13:48:02
    How to check if the Text field is blank
    Hi, 
     
    yes you are right, you should use the Blank() function or compare the string to the built-in IsBlank() function. 
     
    If(TextInput1.Text=Blank() Or IsBlank(TextInput1.Text); true ; false )

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 367 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 193

#3
stampcoin Profile Picture

stampcoin 147

Overall leaderboard
Loading started
Loading complete