Ah, I have found the issue.



This only works for variables that are checked off as mandatory because its checking at display. The ones I need to change are being set to mandatory by a UI policy. Variables that are not mandatory by default will not work with this solution.



I'll see if I can re-work this to check after the UI policy.



Thanks for the help!