The CreatorCon Call for Content is officially open! Get started here.

Hide/Show UI Action using UI Policy

Abhijit Das7
Tera Expert

Hi Everyone,

 

I want to hide/show UI Action using UI Policy. If status of record is deleted then it should hide UI action otherwise it should be visible.

 

UI Action:

Name = Knowledge Article

Action Name = instruct_knowledge

 

8881.JPG

 

I used above method, somehow it is not working.

 

cc: @Ankur Bawiskar @kamlesh kjmar 

 

Thanks in advance

16 REPLIES 16

kamlesh kjmar
Mega Sage

Hi @Abhijit Das7 ,

 

Do not use DOM manipulation it is not a recommended practice. Use the condition of your UI action to control visibility of button on form. Below is an example, where I have a UI action 'My Button' which will hide if state of incident is 'Closed' else it will show for all other states.

 

 

kamleshkjmar_1-1668504317165.png

 

In your case select your table and put in the status logic accordingly. Your condition in condition field of UI action should be something like:

 

current.your_status_field_name != 'value_of_deleted_option'

 

I hope this helps.

 

Regards,

Kamlesh

 

Hi @kamlesh kjmar 

 

My requirement is to get it through UI Policy. I know I can achieve this using Condition field in UI Action. But please help me in above code.

 

Thanks  

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhijit Das7 

Using DOM manipulation is not recommended.

But if you still want to use then ensure Isolate Script field on UI policy is False

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

 

Isolate Script field is False, But still it is not working .

 

Thanks in advance