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

That is pretty awesome! I like this approach, but the main issue is that the fields shown on the data table widget are not editable. I think that is my biggest hurdle at the moment. Any thoughts on that?


Umm that kinda is on ServiceNow, I know we are building our own custom tables to be able to handle custom functionality like that. We recently just finished our first iteration of these custom tables and it definitely has been worth it. We added server side pagination as well as kept "selected records" when the user changes page. I could potentially add some functionality when the user presses the record and a modal pop ups for an edit but that is just an idea at the moment.  



Unfortunately I think you will have have to settle with having the user using the table to press the record and that will navigate to that record for an edit.


I didn't always want a hardcoded "parent.sys_id".



In the case of using sysapproval_approver, the I needed to query against document_id.   Additionally, when using tasks, I pretty much ALWAYS want to filter out Group Approvals.


find_real_file.png



I added two "Child Task" instances.   One for Approvals, One for... Child... Tasks..


find_real_file.png


find_real_file.png



Yields me.


find_real_file.png



A user can see who they are waiting on for Approvals, and Tasks they are waiting on.


Sure, first, make a working copy of your "Ticket Fields" widget.   Now, working on that copy, based on the server side line "data.sys_id = gr.getUniqueValue();", use that data.sys_id variable to query for child tickets and stuff all that data into an array.   Create a data.childTicketsArray variable and stuff that array in there, which it will now be accessible to your Client Script and HTML Template code to use however you see fit.   Oh yeah... don't forget to add your working copy widet to the Ticket Fields page!  


robhaas
Tera Contributor

Could you explain a bit more in layman's terms? I'm looking at what you are putting and also what Philip is putting and attempting to make sense of one solution and get it understood/knocked out.



What I get from this is in a copy of the Tickets Fields widget, I add the data.sys_id = gr.getUniqueValue(); which will grab the sys_id. I'm not sure how to apply that to a 'table from instance definition' widget as the parent.sys_id in order to show all child tasks.