Service Portal - Create data table of child tasks when opening the parent?

robhaas
Tera Contributor

In service portal, I am using the ticket form and referencing TableA (the parent table in this scenario). When this page opens and displays the ticket information, I want to show a table as well that contains all child tasks from TableB with the parent# of the incident I have open on this page. The URL shows the SYS_ID of the parent item, so I'm assuming there may be a way to use table by url definition maybe? I'm not really sure.

Anyone have any insight on how I could accomplish this? Below is the sample URL:

https://xxxx.service-now.com/arp?sys_id=7bc590531387a60002bb7d576144b0c9&view=sp&id=test_ticket&tabl...

Tagging a few people from previous posts as well. Hope you don't mind!

paulw(acorio)

b-rad

1 ACCEPTED SOLUTION
24 REPLIES 24

I would make sure that there is value of parent in the task that you are testing. I would also gs.log($sp.getParameter("sys_id")) and make sure that we are getting that current sys_id of the task record that you are on.



Best,
  Phil


Hey philengles ,



Any idea on how I could modify the form widget to do the same thing as you did here? I was trying to just figure out how to use an embedded list (the list needs to be editable for the customer), but I couldn't figure that out either. My thinking here is if we can replicate the above by showing child items in a form widget, the customer could edit them if need be.



Make sense? Any thoughts?


Hi Robert,
    Yes it is possible. Are you hoping to do this to only one item or to all items? I also would suggest that you do not mess with the out of box code best practice would be to place another widget on the page itself.



Best,


  Philip Engles


Preferably all items I believe. I have just copied the form widget and am attempting the code on the new cloned widget.


Cool well if its all items then you should really be editing the page and not the Form Widget. Clone the Data Table Widget, place necessary code to create the correct query should be using most of the above code.   Navigate to the correct sp_page and create another container/row/instance place your New Data Table Widget in that instance. If you need some help working with the Data Table Widget I would refer you to this post: Data Table Widget



Finally wanted to show off a solution that Techport 13 did for a customer, this widget was attached to a specific item and did not interfere with the out of box code from the form widget (So doing it to all items or just specific items is possible too):   Single Item Widget



  Best Regards,
      Philip Engles