Configure List Layout: Display column based on conditional values from 2 fields

Ken65
Mega Expert

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.

7 REPLIES 7

reginabautista
Kilo Sage

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...

 

Ken65
Mega Expert

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

Chuck Tomasi
Tera Patron

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.

Ken65
Mega Expert

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