Syntax for disabled filter

  1. My goal:
    I need a filter for a button who has to be disabled when the select input (eigentuemer3) is filled.
  2. Issue:
    {{ eigentuemer3.value !== '' || eigentuemer3.value !== null}}
    As you see I have a normal syntax for the button but as you can see in the screenshot below the value is shown as any and because of that the syntax I tried isn´t working.
  3. Retool version & hosting setup (Docker, K8s, cloud provider, etc.):
    Version 3.196.22
  4. Error message(s) or screenshots:

  1. What I’ve tried so far:
    I tried code as followed:

{{ eigentuemer3.value !== '' || eigentuemer3.value !== null || eigentuemer3.value === any}}

OR

{{ eigentuemer3.value !== '' || eigentuemer3.value !== null || eigentuemer3.value === 'any'}}

OR

{{ eigentuemer3.value !== '' || eigentuemer3.value !== null || eigentuemer3.value.any()}}

None of these worked so far and I would really appreciate any input.

Hey @mp23 , could you please try only with {{ eigentuemer3.value }}?

2 Likes

Hi @mp23, the value: any tooltip is saying that the value of the select component could be "any" type, which means it could be a number, a string, an object, null, etc.

As @Marcus_Santos suggested, {{ eigentuemer3.value }} should work nicely. As long as the default value of the select is null, the button will remain enabled until something is selected, and it will evaluate as a "truthy" value if an input has been selected, therefore disabling the button.

1 Like

Such a simple solution haha. Thank you so much.

1 Like