cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Khader
Frequent Visitor

Warning label

Hello,

 

I am new to PowerApps and I have few difficulties with the coding. I'm currently working on an app that check have the employees details.

 

I have created a textbox and a label where the admin can assign a phone number to the user. I want the label to appear if the phone number entered is found in the phone number column. I tried the following code in the Visible property: 

 

If(CountRows(Filter(Table1,IsBlank(User_x0020_Name)&&DataCardValue14.Text in Phone_x0020_Number)) > 0, true,false)

The challenge is that the app doesn't check the number I have entered. Instead, it shows the label when the textbox is blank and then the label disappears if I entered any number. 

 

Can someone please help? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Community Champion
Community Champion

The code looks correct to me, although it could be simplified to this equivalent:

!IsEmpty(Filter(Table1,IsBlank(User_x0020_Name)&&DataCardValue14.Text in Phone_x0020_Number))

The If() is reduntant.

 

Anyway, this will not change the way the code works, so you still have an issue.

I suggest you test both sides of the && separately to see if the issue is with the User Name column or with the Phone Number column.

View solution in original post

2 REPLIES 2
Meneghino
Community Champion
Community Champion

The code looks correct to me, although it could be simplified to this equivalent:

!IsEmpty(Filter(Table1,IsBlank(User_x0020_Name)&&DataCardValue14.Text in Phone_x0020_Number))

The If() is reduntant.

 

Anyway, this will not change the way the code works, so you still have an issue.

I suggest you test both sides of the && separately to see if the issue is with the User Name column or with the Phone Number column.

Thanks a lot. I found the issue. My username shouldn't be empty. I will be able to assign a number to an employee if the number is found AND there is no user assigned to that number. 

 

New Code: 

!IsEmpty(Filter(Table1,DataCardValue14.Text in Phone_x0020_Number,!IsBlank(User_x0020_Name)))

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,890)