cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pat_Wickramage
Level: Powered On

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
Pat_Wickramage
Level: Powered On

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

4 REPLIES 4
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..

Pat_Wickramage
Level: Powered On

Re: Strange error in simple if statement

Tried it already. Still the same error.

This is fustrating 🙂

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)

Pat_Wickramage
Level: Powered On

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

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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