web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to check if a Text...
Power Apps
Answered

How to check if a Text Input Control is empty? / Check if Text Input Control is empty fails.

(0) ShareShare
ReportReport
Posted on by 5

I have several input control fields, two text inputs and two dropdowns. The text inputs are called NamePicker and PricePicker and the dropdowns are called CategoryPicker and ColorPicker. Below that I have a button that contains the following if statement:

(SPProductList is the name of my SharePoint connector) 

 

 

UpdateContext({error:""});;
If(
 NamePicker in SPProductList.'Name (Title)';
 UpdateContext({error: "nameexists"});
 IsEmpty(NamePicker.Text);
 UpdateContext({error: "emptyname"});
 IsEmpty(CategoryPicker.SelectedText.Value);
 UpdateContext({error: "emptycategory"});
 IsEmpty(PricePicker.Text);
 UpdateContext({error: "emptyprice"});
 IsEmpty(ColorPicker.SelectedText.Value);
 UpdateContext({error: "emptycolor"});
 error="";
 UpdateContext({SaveAttempt: true})
)

 

 

This is the layout:

image.pngAs you can see, the text input fields contain only hint text, which I don't check for. Nevertheless, the button continues with UpdateContext({SaveAttempt: true}), which I don't want in that case. When I added a label with the visible property "IsEmpty(NamePicker)", it remained invisible even though it should be visible.

Is there something I'm missing or doing wrong here? Any advice is much appreciated!

Categories:
I have the same question (0)
  • Verified answer
    shoog Profile Picture
    2,164 on at

    Replacing IsEmpty with IsBlank should fix this.

    IsEmpty is used to check for empty tables, IsBlank is used for checking text.

  • Anonymous123456 Profile Picture
    5 on at

    Wow, thank you very much, that solved it! No idea why I even used IsEmpty in the first place, because I used IsBlank before in other cases xD

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard