Enable disable button based on dynamic form input

Requirement : A Button on page needs to be enabled as soon as a form “data” (string type) variable has a value in it.
If the value is removed via some actions on form, then the button needs to be again disabled.

I know we can do this using Logic available within form button component and using trigger as Javascript via passing result as true / false. However, unable to get the true / false value in that result based on this “data” input variable.

how did you do this? do you have an answer already?