Using when rules to drive field visibility appears to be unreliable in some cases

I am rebuilding a view that was built pre-constellation and am currently on version 25.1.2.

I am trying to reuse when conditions and the more simple ones work, but more complex ones are failing? Is this a bug, or known/intended behavior.

is “is not equal to” a problem with constellation? This seems to be the common aspect of the two when conditions that are giving me trouble.

Hi @ChrisBoone

If the when rules were already working in your previous version and not working in the latest version, then you could try the below options,

  1. Try to revalidate and save the when rules (in the same version they are in) which are in your issue scope.
  2. See if you have the relevant records available for those when rules. If possible using Manage relevant records landing page, mark them as inactive and make them active again.
  3. If possible, for testing purpose, save as the when rule in a new/latest version and see if it works. If possible and some new dummy true conditions as well (just for testing).
  4. If possible clear the rule cache and do a clean restart of the server.

At least with the above options you will understand the issue pattern and most probably should resolve your issue

Hope this helps

Regards

JC

@ChrisBoone in Constellation, when rules fire server side, conditions (in the View, what you would of called expression in UI Kit) fire client side.

  • Instead of using when rules for visibility, disabled, read-only settings, use custom conditions. Custom conditions are executed on the client side and do not require a server-side refresh call, reducing the likelihood of race conditions.

Given the architectural change, maybe it has to do with where the data is and has been updated from?

Other points on note:

  1. It’s interesting that “is not equal to” is the commonality… I have not seen that being raised previously.
  2. I also see you are using Questionnaires? That has its own case architecture, so might not be acting exactly like a platform case. Maybe that is the cause?
  3. Are any of theses fields “read only”? they are excluded from some payloads, which might make the rule fire incorrectly?
  4. Do you have any Form Refresh Settings firing at the same time? They can get in each others way. Avoid using both form refresh settings and when-based conditions or calculated fields in the same flow action/view combination. This can help prevent race conditions where multiple refresh calls interfere with each other.
  5. Do you have repeating dynamic layouts? (I remember another question from yourself recently). Combined with other things like Form Refresh Settings, you might have conflicting cascading logic that is getting in the way.

Thanks. This is for views that are launched using a modal from a list. I have switched to using in-line custom conditions and those are working. I was just caught off guard because I had reused when conditions in other places, but the UI was more simple - and the problems are not limited to the Not Equal condition not that I am in full testing mode. Fortunately, custom conditions do allow for complex combinations of conditions or I would be in trouble. And I do have field refresh event handling going.

I have also had to style away fields that need to be present and “visible” but shouldn’t be seen. Josh H helped me with that.

1 Like

great to hear! If you have some insights to share, help others in the future please submit a “knowledge share” and we will add to our Constellation 101