How can we hide a field based conditions in Related list columns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 01:46 AM
Hello guys,
How can I hide a Size field from the related list view based on conditions?
For example:
1. If Size = "empty" in related list view, Then we don't see the size column in a related list.
2. If Size = anything, Then we see the Size column in a related list. -It's Working fine
Regards,
Raj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 01:49 AM
Hi there,
There's no out-of-the-box feature for this. You could mimic this thru scripting, removing/adding the column on the list. Note that it's just always having the column or not. So if you have a list with the field sometimes empty, sometimes filled, then probably you would just want that column.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2020 11:26 PM
Hi Mark,
What kind of scripts can we use to hide columns in the related list tab
either ACLs or Client Script or UI policies or something else
could you please suggest me, thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 02:03 AM
Hi,
Raj
Hiding and Showing Related Lists
I’m using the ‘Affected CIs’ related list as an example in these scripts. Replace ‘task_ci’ below with the table name of your related list.
Hiding a Related List
Showing a Related List

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 02:18 AM
So what if some of the records contain a size values, some don't?
How would you show a table (so that it will look different from how it is shown usually) where some rows have that cell displayed, some don't?
On the other hand, if the visibility of the size column depends on the record in the form, you could create a view rule for the record and customize the related list for that view:
1. one form view where the size should be show and the related list will have a size column.
2. another form view where the size should not be shown and the relate list thus will have no size column.
Looking at your examples you would define two views for the Request form: "Items with Size" and "Item without Size".
Than you would define two view rules:
- one that makes the form use the 1st view if the current request has a requested item child record that has size information and
- another that makes the form use the 2nd view if the current request has no requested item children that have size information.
Than you'd open requests for both views and you'd customize the related list for each.