Data Table From URL Definition Widget

xfhjn
Kilo Contributor

Hi all,

Using the Data Table From URL Definition widget in the Service Portal that comes with Helsinki.   Cloned it so that I could make it work for me.   I added the table name (cases) and added the fields I wanted to see.   That however doesn't seem to be what that field means when I edit the widget.   The widget defaults to 4 fields (Number,Task Type ,Short Description and Priority).   I did not select all of these and actually added a couple others I wanted to see but they don't show.   I love the look of the table that it presents, but it's just not acting the way I expected.I know that If I use other widget: 'Data Table From Instance Definition'   it will be worked fine, but I need actually this widget because I have to pass a parameter from other widget in the URL.   What am I missing about customizing/configuring a widget?

Does someone have any idea?

thanks,

Michal

מ×�×� שב×�ןמע ×�×™×§ 'שט ן קספקב×�קגץן למ×�' ×�יש×� ןכ ן ודק ×�×�יקר 'ןגעק×�: ,גש×�ש ×�שנךק כר×�צ ןמד×�שמבק גקכןמן×�ן×�מ,   ן×� 'ןךך × ×§ '×�רלקג כןמקת נו×� ן מקקג actually   'יש×� שצ ן צןדדןמע שנ×�ו×�

13 REPLIES 13

Robert_Cartwrig
Tera Expert

Same issue here...as the page is defined from the URL, there is no actual page or widget to edit - so how do we set the parameters of the data that is displayed?



The configs I need to make are:


1) remove breadcrumbs


2) make page Public


3) display only the "Short Description" column


4) add a button to take user to the Record Producer



Thank you,


Robert


I stand corrected...there is a page called List and a Widget.   I was able to clone the widget and configure it to display what I wanted as well as customize the list page.



This is resolved for me.


david_myers
Tera Contributor

I too need to set different columns using this widget.     Ideally, I want to pass the table and fields into this page as parameters, so I can build URLs to display differently for other tables.       This seems to work.



I cloned the 'Data Table From Instance Definition' Widget.   In the server script I added this line.  



if (input) {
data.table = input.table;
data.view = input.view;
} else {
data.table = $sp.getParameter('table') || $sp.getParameter('t');
data.view = $sp.getParameter('view');
data.fields = $sp.getParameter('fields');
}


Then I commented out the line that sets the default fields in the parameters.


  // widget parameters


  data.table_label = gr.getLabel();


  //data.fields = $sp.getListColumns(data.table, data.view);


  data.title = gr.getPlural();



Then in the URL add a comma separated list of field names in the parameter.


?id=ess_open_urldef&?id=list&table=task&fields=number,short_description&filter=active=true^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe


jesseadams
ServiceNow Employee
ServiceNow Employee

Hi Michal,


When you use data table from URL definition it is configured very similar to the way you would configure a list in the rest of the platform but with enough small differences to make it tricky.



Basically, this widget will pull the list of fields to show from a standard list view. We specify the view we want to use in our URL using the view parameter.


In the platform UI you would use sysparm_view=<some_view_name> but in Service Portal you just use view=<some_view_name>



So, for example if I have a page called list_from_url that uses the data table from URL widget I can use this URL


/sp/?id=list_from_url&table=incident&view=Major%20Incidents&filter=assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe



to show an incident list using the Major Incident view and with a dynamic filter (assigned_to is me).