cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J_Taylor
Helper II
Helper II

IF functions not displaying due to incompatible types for comparison

I am having an issue where an icon is not being displayed when first loading the app because the variable has not been initialised. I tried to get around this by having an IsBlank or IsBlankOrError function along with an If statement, but it keeps coming up with the error. The error is specifically:

 

Incompatible types for comparison. These types can't be compared: Text, Number.

 

I previously has the variable set to a Boolean and I still received the same error (e.g., "Text, Boolean").

 

The function is: If(IsBlankOrError(Help=0), true, Help=0). Since Help does not have a value, I am getting an error at Help=0 (both). I tried to get around this by the IsBlankOrError part which does not seem to see that Help=0 is an error. Previously, I had If(IsBlank(Help), true, Help=0). This still had an issue with the latter Help=0 - even though it would not need to evaluate that section due to the IsBlank(Help) which would then be true.

 

I hope this makes sense. Any assistance would be great.

2 ACCEPTED SOLUTIONS

Accepted Solutions
AJ_Z
Super User
Super User

Hey @J_Taylor 

 

Just a few ideas to start with would it help if the variable was initialised onstart and set to 0? 

Also is help being set to text at anypoint does Help = "0"

with the quotes make the error disappear?

 

How is Help being Set :)?

 

 

 

If that does not fit your needs



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

View solution in original post

AJ_Z
Super User
Super User

To set it on start

 

First find the App and click on it it will be above the first screen:

AJ_Z_0-1655860550933.png

 

then when you click it change the property to onstart:

AJ_Z_1-1655860593847.pngAJ_Z_2-1655860631828.png

as it usually shows startscreen

 

then inside of here set the variable:

 

AJ_Z_3-1655860742515.png

 

whenever the app starts it will now set it.

 

as you are in edit mode make sure you run onstart to initialize the variable for you:

so click three dots and run onstart

AJ_Z_4-1655860812347.png

 



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

View solution in original post

4 REPLIES 4
AJ_Z
Super User
Super User

Hey @J_Taylor 

 

Just a few ideas to start with would it help if the variable was initialised onstart and set to 0? 

Also is help being set to text at anypoint does Help = "0"

with the quotes make the error disappear?

 

How is Help being Set :)?

 

 

 

If that does not fit your needs



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Thanks for the ideas, @AJ_Z

 

I tried setting Help to text "On" and "Off" [Set(Help,"On")]. I don't get an error anymore. However, it does not display on startup. The code is: If(IsBlank(Help), true, Help="Off") - which is equal to true at the start. However, it still seems to be invisible. 

 

How does one set Help to a value on start?

AJ_Z
Super User
Super User

To set it on start

 

First find the App and click on it it will be above the first screen:

AJ_Z_0-1655860550933.png

 

then when you click it change the property to onstart:

AJ_Z_1-1655860593847.pngAJ_Z_2-1655860631828.png

as it usually shows startscreen

 

then inside of here set the variable:

 

AJ_Z_3-1655860742515.png

 

whenever the app starts it will now set it.

 

as you are in edit mode make sure you run onstart to initialize the variable for you:

so click three dots and run onstart

AJ_Z_4-1655860812347.png

 



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Thanks, @AJ_Z.

 

I was able to set Help as false from the beginning which made everything much easier. Thank you for the OnStart idea to bypass the whole issue.  

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,909)