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

DisplayMode with TextBox entry not working if IsBLank

Hi,

So I have an app that can be used to evaluate. So, I have a text box where the evaluator could enter the grade. And I have a button to validate when this is done.

 

In the visible property I put the interval between 0 and 100 to show this botton because an evaluator can grade someone as bad as 0:

If (NM_18.Value>=0 && NM_18.Value<=100; true; false)

 

But I dont wan't the evaluator to validate and forget to grade, so on the display mode property, I want that, if the evaluator didn't put anything, he could not validate the evaluation :

 

If (!IsBlank(NM_18.Value);DisplayMode.Edit; DisplayMode.Disabled)

 

The problem with this code is that when an user hasn't touched the app, the displaymode remains as Edit. Once an user clicks on the text imput to modify it and deletes the value, the displaymode goes on displaymode. But I want the display mode to be disabled the first time an user enters to the screen and hasn't touched anything.

PowerAppsMx_0-1663934632601.png

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@theapurva 

This formula reduces to true 

NM_18.Value>=0 && NM_18.Value<=100&&!IsBlank(NM_18.Value)

There is no need for an If() statement in a Visible property.  

View solution in original post

5 REPLIES 5
Drrickryp
Super User
Super User

@PowerAppsMx 

Set the Default value of NM_18 to Blank(), Reset(NM_18.Value) in the OnVisible property of the screen, and in the DisplayMode property of the button If(IsBlank(NM_18.Value);DisplayMode.Disabled; DisplayMode.Edit).  However, it is not clear to me how this will matter if the button is not visible when the TextInput box doesn't contain a value between 0 and 100.

theapurva
Super User
Super User

Hello @PowerAppsMx :

First of all not sure how are you using .Value for textInput.
Could you please tell which control are you using for rating?

you can try this:

If (NM_18.Value>=0 && NM_18.Value<=100&&!IsBlank(NM_18.Value), true,false)

-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee
Drrickryp
Super User
Super User

@theapurva 

This formula reduces to true 

NM_18.Value>=0 && NM_18.Value<=100&&!IsBlank(NM_18.Value)

There is no need for an If() statement in a Visible property.  

agree.. @Drrickryp : My Bad..I now understood that rating control is used.
setting Blank() in default is not working. so we need to check if Rating was clicked or not.

-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee
theapurva
Super User
Super User

Hello @PowerAppsMx ,
I believe one way is to set a flag on select of rating..Onselect should be

Set(RatingGiven,true)

theapurva_0-1663949854125.png

 

Now your formula should be:

If (RatingGiven&&!IsBlank(NM_18.Value),DisplayMode.Edit, DisplayMode.Disabled)

 

-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (3,113)