cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Strange error in simple if statement

I am banging my head around a tiny equation which gives 'blue underline' error.

 

The equation is;

If(IsEmpty(Value2.Text), DisplayMode.Disabled, DisplayMode.Edit)

same as;

If(IsEmpty(Value2), DisplayMode.Disabled, DisplayMode.Edit)

 

This gives me "Expecting a true or false value. The current value may cause unexpected behavior"

 

Plz tell me I am not going mad.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper III
Helper III

Re: Strange error in simple if statement

Figured it out.

The equations I have been trying to put in was under 'visible'.

Instead of that it should go to 'displaymode'.

Now its working.

View solution in original post

5 REPLIES 5
Highlighted
Anonymous
Not applicable

Re: Strange error in simple if statement

Hi Pat_Wickramage

Perhaps try "IsBlank" instead of "IsEmpty"? 

Else i cannot spot anything either..

Highlighted
Helper III
Helper III

Re: Strange error in simple if statement

Tried it already. Still the same error.

This is fustrating 🙂

Highlighted
Anonymous
Not applicable

Re: Strange error in simple if statement

Hi Pat_Wickramage

 

I think the issue lies within 'Value2' rather than the formula. 

Just tested this myself with a textinput field that is called 'Value2' and both statements you listed work without error. 

 

Capture.JPG

 

What exactly does Value2 refer to - a variable?

In that case you may need to change the statement to say  If (Variable2 = "", DisplayMode.Disabled, DisplayMode.Edit)

Highlighted
Helper III
Helper III

Re: Strange error in simple if statement

Figured it out.

The equations I have been trying to put in was under 'visible'.

Instead of that it should go to 'displaymode'.

Now its working.

View solution in original post

Highlighted
Frequent Visitor

Re: Strange error in simple if statement

It would be nice if MS put a suggestion linking Display Mode and Visibility in the Help notes/field as this is (apparently) something many of us have [still] done by mistake.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,396)