Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Clarification on UI Action visibility in M2M related list

bharathpada
Mega Contributor

We have implemented a custom UI Action on the m2m_kb_task table. The button is not appearing in the related list view under the Problem form. We would like to confirm whether UI Actions are supported on M2M related lists, and if not, what is the recommended approach to achieve similar functionality.

Thank you for your assistance.

1 REPLY 1

Naveen20
ServiceNow Employee

 

UI Actions configured as list-level buttons or list choices do not render on M2M (many-to-many) related lists. This applies to any table that acts as a join/relationship table displayed as an M2M related list on a parent form — including m2m_kb_task. ServiceNow's M2M related list renderer simply doesn't invoke the standard UI Action framework the way a normal list view or regular related list does. This is by design, not a bug.

You can confirm this yourself: if you navigate directly to the m2m_kb_task list view (e.g., via /m2m_kb_task_list.do), the UI Action button will appear there. It only disappears when the same table is rendered as an M2M related list embedded on the Problem form.

Recommended approaches

1. UI Action on the parent form instead. If the action operates on the related records collectively, place the UI Action on the problem table as a form button or form context menu item. From there, your server-side script can query the M2M table using GlideRecord against m2m_kb_task filtered by current.sys_id and perform the needed logic. This is the simplest and most upgrade-safe approach.

2. Convert to a regular related list with a reference field approach. Instead of using the M2M relationship, create a custom child table with explicit reference fields to both parent tables. A regular related list fully supports UI Actions — list buttons, list choices, row-level actions, and context menus all work as expected. This is the cleanest long-term solution if the M2M pattern isn't strictly required by your data model.