UI action - Form Button visibility based on a condition

KamakshiM
Tera Contributor

I am trying to display a form button UI action based on the value selected for a field called 'Project'

in the form.

I added the condition in the UI action and it works fine when the form loads.

But when I change the value of Project in the form, it does not disappear.

For this, I created a UI policy and tried this :

$$(UI action name)[0].show() and
$$(UI action name)[0].hide().
Please note, I set the Isolate Script to false.
But I am getting this error when I test it: onChange script error: TypeError: $$ is not a function function () { [native code] }
This is in my PDI on Xanadu version.
Any idea why this is not working?

 

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

@KamakshiM 

This is not something we can achieve this, and it is also not recommended to hide ui action via script.

UI action will evaluates condition only when the form loads

Thanks,
Murthy

View solution in original post

2 REPLIES 2

Murthy Ch
Giga Sage

@KamakshiM 

This is not something we can achieve this, and it is also not recommended to hide ui action via script.

UI action will evaluates condition only when the form loads

Thanks,
Murthy

Thank you.

I achieved the same action using a flow.