How to hide a field based on incident table state in Service Portal widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2018 02:17 AM
Hi,
I want to hide a field when the state of incident table is either Resolved or Closed in portal. Can anyone tell me how to do that?
Thanks in advance!
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2018 02:21 AM
Hi Naina,
The best option is to create UI Action on portal side then you could follow below approach:
Server side script:
data.hideButton = true;
if(data.table == 'tableName' && data.f._fields.state.display_value == "Choice Display Value"){
data.hideButton = false;
}
HTML Template:
<button ng-hide="data.hideButton">
Hope this will fit your need!
Please, remember to mark Correct or Helpful if you find my response useful.
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2018 01:17 AM
Hi Alberto,
Thanks for your response! I tried this but unfortunately it is not fetching the value of incident_state field, undefined, is what I am getting as the value of this particular field, due to which the if condition is not working properly. Do you have a way to fetch the value of incident_state field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 10:30 PM
Hello Alberto,
I am trying to use the above code for hiding a button on portal for a specific condition ie. when company is Hogarth then it should hide the button but not able to get what to put in condition. Below sharing code snippet can you please help with this ?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2018 02:50 AM
If you are using "form" widget, then use client script to hide it.
Thanks