how can I use ui action to hide button?What is the ui action visibility?

roop1
Kilo Contributor

how can I use ui action to hide  button?What is the ui action visibility?

 

1 ACCEPTED SOLUTION

Hi,

that's correct

The UI action will only be shown when incident is in Resolved state.

For all other states it will be hidden

UI Action condition evaluate when form loads

Happy learning

Regards
Ankur

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

View solution in original post

12 REPLIES 12

roop1
Kilo Contributor

Sir, how can i give condition when  button A should be hide on click of other button B. 

Hi Roop,

What is your business use-case/requirement here? If you could explain that

UI Action conditions are evaluated only once i.e. when form loads

Why you want to hide button A on click of button B?

Although this is possible using DOM manipulation but it is not recommended

You can have conditions for both the UI Actions in such a way that at one time only 1 is visible

Regards
Ankur

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

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Roop,

UI action will be shown or hidden based on the condition field only during the form load. That said you can use a Client script to show or hide based on a field value via Dom manipulation (**NOT recommended**). They are really designed for edge cases where there is no other real solution available. If at all possible, you should use the standard ‘Condition’ field (for role-specific or other criteria) or the ‘UI Action Visibility’ related list (for view-specific criteria) on a UI action and stick to the out-of-box functionality in these cases.

https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/

 

- Pradeep Sharma

 

Hi,

on A Button click  if you are updating any field into database like changing state field so based on that state you can make button B visible using condition .

example .current.state=="0"||current.state=="1"

here 0,1 are the state values ,you can add your state value if you want to make buttion B visible based on state change.

If you have different condition please mention it here so i can help you.

If this answer helps then please mark it as correct and helpful.

Thanks,

Manjusha

roop1
Kilo Contributor
I have given this condition but not able to show button when I Press resolve button. I have given value of state as resolved instead of number.