- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 05:57 AM
Hi all,
I have requirement to create buttons for a data table widget for each row in a list on Service portal. How to create buttons for each row like the below image?
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 06:27 AM
Hi,
Please refer to prior discussion similar to what you're wanting to do here: https://community.servicenow.com/community?id=community_question&sys_id=94ea2e80db6b10107d3e02d5ca96...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
I invite you to visit my ServiceNow focused YouTube channel: Allenovation!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 06:27 AM
Hi,
Please refer to prior discussion similar to what you're wanting to do here: https://community.servicenow.com/community?id=community_question&sys_id=94ea2e80db6b10107d3e02d5ca96...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
I invite you to visit my ServiceNow focused YouTube channel: Allenovation!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 08:02 AM
The solutions proposed so far are based on cloning the OOTB widget. I would advice not to do that as from the point of cloning, you are responsible of maintaining the item.
Every upgrade you have to compare and patch the cloned widget (because your cloned widget will not be included in the upgrade records, you have to manually check this!). Most importantly, you will not receive any security hotfixes by ServiceNow: This introduces a great security risk.
Instead you could use the "embedded widget" way (just a rough scratch):
data.widget = $sp.getWidget('widget-data-table',...)
data.widget.template = data.widget.template.replace("add the buttons column here", ...)
There is a Application in the ServiceNow AppStore that includes the feature you are looking for (Swiss Tool😞
It is implemented in a upgrade save way so you don't have to worry about maintenance, also it allows comfortable button client side code, styling and disable/enable states.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2022 09:18 AM
Hello,
There's only been 1 solution proposed thus far and that's mine, so I assume you're addressing me and what I wrote.
Cloning a widget, it merely a way to jump start your own widget and either way, it's custom...on purpose. They want a feature that isn't available out of box, so...you have to create it. Your suggestion is also through a custom widget and altering the script to then embed another widget inside of it or...pay for a store app (which is also a custom widget or widgets on top/using out of box widgets).
Per your logic, no one should create any custom widget, which differs greatly from one of the major points behind the portal and widgets, etc.
In any case, custom widgets are being used.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
I invite you to visit my ServiceNow focused YouTube channel: Allenovation!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2022 11:18 AM
You miss my point. I am not saying not to use custom widgets. I am saying not to clone OOTB widgets (for the reasons stated above).
Adding Button Support for the Data Table Widget can be achieved by either creating a custom widget and embedding the OOTB widget-data-table (wrapping technique) or even by adding a sibling-widget that injects the buttons (i have shown a proof of concept for this for the ootb widget-form in an article here in this forum).
Cloning a core component of ServiceNow is by far the worst of all possibilities, and if not maintained might maybe "include" one feature - but you lose every new feature to come by ServiceNow. Seeing just your own feature is very short sighted. If one would argue that he/she is still able to handle the maintenance of customized widgets, then he/she would also have the technically skills to implement it with the wrapping or injection technique.
In regards of paying for a app: After cloning, the widget will no longer be detected as modified by the ServiceNow Upgrade Mechanism. You will not be receiving any hotfixes either. By all means: The price you have to pay for implementing this to be on the OOTB-Level will be greater than what an app would cost.