Change related list view based on state

samadam
Kilo Sage

I have a record that has related list to another table. Is there a way to adjust the list view fields for related list based on the state of the parent record? If that is not possible is there a way to automatically change views based on the state? 

4 REPLIES 4

yashkamde
Tera Expert

Hello @samadam 

First of all create a View by Navigating System UI -> Views 
Select the fields or section you want in related list..
Screenshot 2026-01-15 093840.png

 

and then create a view rule
where select name, advanced checkbox - true, table - (like incident), view - created from above (name),

Screenshot 2026-01-15 094559.png


If my solution is helpful mark as helpul and accept the solution..

Script :

(function overrideView(view, is_list) {
    answer = null;

    // Only apply on form view (not list view)
    if (!is_list) {
        if(current.state) {
                answer = 'Custum View';
        }
    }

})(view, is_list);


case 1: // New
answer = 'Default View';
break;
case 2: // In Progress
answer = 'Work View';
break;
case 3: // On Hold
answer = 'Hold View';
break;
case 6: // Resolved
answer = 'Resolved View';
break;
case 7: // Closed
answer = 'Closed View';
break;
default:
answer = 'Default View';
}
}

})(view, is_list);

VaishnaviK43271
Tera Contributor

Hi @samadam !!

No, ServiceNow does not support dynamically changing related list columns or switching list views based on the parent record’s state out-of-the-box.

Related list layouts and views are static and cannot be controlled by conditions, client scripts, or business rules.

Workaround / Best Practice:
You can add multiple related lists for the same child table on the parent form, each with:

  • A different view

  • A condition based on the parent record’s state

Only the related list whose condition matches the current state will be displayed.

 

Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.

Regards,
Vaishnavi
Associate Technical Consultant

Ankur Bawiskar
Tera Patron

@samadam 

is that a defined relationship or an OOTB one?

share screenshots

Related list will inherit view of the form you are on

I doubt this is feasible

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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