I need to disable a button inside a gallery.

Trying these two expressions, both giving error.

Thoughts please! Thank you.

I tried:

If(Value(TextInput7_2.Text) > Value(TextInput7.Text), DisplayMode.Disabled, Edit)


If(ThisItem.Cost_mitigation_1 > ThisItem.effect_mitigation_1, DisplayMode.Disabled, Edit)
  • What is the error message? Are these text inputs added inside the gallery? If data type of your columns in "Number", try using formula like: If(ThisItem.Cost_mitigation_1 > ThisItem.effect_mitigation_1, DisplayMode.Disabled, DisplayMode.Edit). Also, make sure you are using correct names of your columns. Let me know if this helps. Nov 30, 2023 at 12:02
  • Ganesh, did not work. This is the error I have: Invalid argument type: expecting one of the following: number, decimal...
    – Jose1978
    Nov 30, 2023 at 12:23
  • What is the column/data type of Cost_mitigation_1 and effect_mitigation_1? If not number, try using: If(Value(ThisItem.Cost_mitigation_1) > Value(ThisItem.effect_mitigation_1), DisplayMode.Disabled, DisplayMode.Edit). Nov 30, 2023 at 12:25
  • 1
    brilliant! last expression worked nicely! Thanks a mill for your support! as always!
    – Jose1978
    Nov 30, 2023 at 12:38
  • Great, glad it worked for you! Nov 30, 2023 at 12:53

1 Answer 1


Is the column/data type of Cost_mitigation_1 and effect_mitigation_1 not "Number", try using formula in Power Apps like this:

   Value(ThisItem.Cost_mitigation_1) > Value(ThisItem.effect_mitigation_1),

Value function will return the numeric data type for string inputs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.