Conditional Visibility for Dynamic dialog based on Expression Methods


#1

Hi everybody,

I use some dynamics dropdown in my service dialogs based on Expression Method.

Is there a way to control visibility of the field for based expression methods dialog ?

For example, a checkbox with true/false displaying a text box or not.

I’ve already done that kind of things using Automate methods but I’d want to use the many advantages of the Expression Methods ( faster, RBAC, etc … ) for my dynamics dialogs.

Thanks !


#2

As far as I know Expression Methods to not support setting visibility. They support some parameters to customize their behaviour.

Given how dynamic dialog elements work with ruby methods, calling an Automate Instance, and reading the results from $evm.object I guess you can try this:

  • Create an Instance with 2 states. The first step is the expression method and the second step is a ruby method that only sets the visibility
  • Try to trick the code:
    • Create an Instance with two states as before

    • The first state is the normal expression method

    • The second state is an expression method with result_attr set to visible , set default_value to false and create an expression that returns something when the element should be visible and returns nothing if the element should be invisible.

      You can also try to get a true/false value using the attributes , result_type and/or result_obj parameters

With the first idea you will loose (some) of the speed expression methods have.
The second idea is very hacky, but I would be very curious if this actually works. We have the same use-case and I was planning on trying that, but haven’t had time yet