Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Y04rf2Cr4zM2QFwq6fGepE
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
    146,920 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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 68 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 38

Overall leaderboard