cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Johns222
Helper I
Helper I

Incompatible types for comparison. These types cant be compared: OptionSetValue(Type), Table ?

Hi all, 

 

I am trying to disable a button if a user clicks it. Right now they can click it multiple times which leaves multiple Login entries in the database. 

 

I have this formula on the button - 

 

 

 

If(IsEmpty(Filter('Staging', 'Action (Log In/Log Out)' = Choices(Type), 'Employee ID'=VarID)), DisplayMode.Edit, DisplayMode.Disabled)

 

 

It gives me this error - 

Incompatible types for comparison. These types cant be compared: OptionSetValue(Type), Table

We cant evaluate your formula because the values being compared in the formula arent the same type. 

 

Is there any way around this? 

 

Thank you for any help. 

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Community Champion
Community Champion

Hi @Johns222 ,

Please update the below formula as your requirement. If and is required use below formula else replace the && by ||. 

Let me know if it helps.

 

	If(IsEmpty(Filter('Staging', 'Action (Log In/Log Out)' = Choices(Type) && 'Employee ID'=VarID)), DisplayMode.Edit, DisplayMode.Disabled)

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

5 REPLIES 5
Ramole
Super User
Super User

Hi @Johns222 

Try !IsBlank instead of IsEmpty

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
PG_WorXz10
Community Champion
Community Champion

Hi @Johns222 ,

Please update the below formula as your requirement. If and is required use below formula else replace the && by ||. 

Let me know if it helps.

 

	If(IsEmpty(Filter('Staging', 'Action (Log In/Log Out)' = Choices(Type) && 'Employee ID'=VarID)), DisplayMode.Edit, DisplayMode.Disabled)

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Johns222
Helper I
Helper I

Hi @PG_WorXz10 

 

Thanks for helping. 

 

I still get the same error as seen in the screenshots. 

@Johns222 

 

Is it Choice field, just add at end .Value

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
PG_WorXz10
Community Champion
Community Champion

Hi @Johns222 ,

 

Could please explain if the value mentioned below is a selected value from any of the dropdown ? 

Currently it seems a collection of choices and you cannot perform = operation on it. Could you please explain the purpose of below value so that we can modify the  formula accordingly. 

Choices(Type)

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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 (2,700)