How to show / hide buttons on the form based on condition

Chaitanya Redd1
Tera Guru

Hello Team,

Example : I have raised the ticket based on category & sub category priority & Assignment group is been auto populate. After submitting new request the state will be in new till I move it to in progress. Here I have created widget as you can see below it will be visible only when state is new and visible to requestor of the ticket only. once the requestor clicks on Re-prioritise request then it will show values then after selecting and submitting it then it will send email notification to Assignment group/ Assigned to. Here I have created Accept Priority & Reject priority buttons on the form but buttons are always visible I have tried to hide based on condition it has to visible .I need this buttons has to visible when requestor submits new priority value. 

1)find_real_file.png

2) find_real_file.png

 

3) find_real_file.png

4) find_real_file.png

Here I need your help that I'm trying to hide the buttons but I can't they are still visible. and when select the reject priority then priority value has to change to previous value and email notification has to triggered  which has been auto populate based on category & sub category it's also not working and when I select Accept priority then no need of new value to change but email has to triggered none of this working.

 

Can any suggestions will be helpful.

 

Thanks,

Chaitanya

1 ACCEPTED SOLUTION

Hi Chaitanya,

You should not show/hide the UI actions on change of field values.

UI Action conditions help to show/hide the button on form and run only once when form loads.

I won't recommend showing/hiding it using client script or UI policy.

Still if you require buttons to be shown/hidden based on priority value then you can try this link below

For client script or UI policy you create

Set Isolate Script field to false; by default it is true

https://community.servicenow.com/community?id=community_question&sys_id=2cf54361db1cdbc01dcaf3231f96...

Regards
Ankur

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

View solution in original post

3 REPLIES 3

BryanS413339635
Tera Guru

Are you expecting the buttons to appear/disappear on change of the New Priority value? The UI actions are on the server side so the conditions won't apply/refresh until the form is saved. 

You're right but after submitting new value on priority then only Ui Action button should visible but it's always visible.

Hi Chaitanya,

You should not show/hide the UI actions on change of field values.

UI Action conditions help to show/hide the button on form and run only once when form loads.

I won't recommend showing/hiding it using client script or UI policy.

Still if you require buttons to be shown/hidden based on priority value then you can try this link below

For client script or UI policy you create

Set Isolate Script field to false; by default it is true

https://community.servicenow.com/community?id=community_question&sys_id=2cf54361db1cdbc01dcaf3231f96...

Regards
Ankur

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