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!
Solved! Go to Solution.
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.
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)))