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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,895)