Configure List Layout: Display column based on conditional values from 2 fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 05:57 AM
Hello -
I need to create a column in a list which is the result of one of two values, based on a condition. For example, if I need to show a column which would be drawn from a demand or a project depending on the status, how would the script look to do that. If anyone can point me to an existing post or provide a code snippet, it would be greatly appreciated.
Thanks in advance.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 06:12 AM
Hi I don't think it's possible to hide the physical columns. But you could restrict the value by creating an ACL READ rule.
Please see instructions below on how to achieve this:https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/contextual-securit...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 06:16 AM
In other words, I am looking to create a single column from two existing database columns, based on a condition. I am pretty sure that can be done, although admittedly, I don't know how

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 06:17 AM
We don't have conditional column viewing at this point. I suggest you use an ACL to display or hide the value for each record since each record could different conditions. Example:
Record 1: State=Open, Pri=1 - so show Short Description
Record 2: State = Closed, Pri=2, so don't know Short description.
In your scenario, you want to modify the list based on a condition, but each record could contradict. With an ACL on each record, you can show or hide the values in that column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2019 06:22 AM
So through scripting I can't display a single value from one of 2 tw sources depending on a condition. So how could I create a column in a script based if I wanted to add a string to an existing column.
Thank you for your responses and I apologize if my initial question wasn't clear