Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

What is the $sp.getListColumns default view?

Giles Lewis
Tera Guru

If I run this script

var fields = new GlideSPScriptable().getListColumns('incident',null);
gs.info(fields);

It prints "number,category,short_description,priority".

 

Where is this list of fields coming from?

 

I thought it might be coming from the Incident list configuration for the "Portal" view (sys_ui_list).  The OOB list of fields is number, category, short_description, priority. But after I changed the list, the function still returned the original.

2 REPLIES 2

Gangadhar Ravi
Giga Sage

that function returns fields in a view. but passing null returned same results to me. but below script returned list of fields in default list view.

 

 

var fields = new GlideSPScriptable().getListColumns('incident','default');
gs.info(fields);

 

 

Not applicable

@Giles Lewis 

FYI. the getListColumns() returns the default columns as you may know.

Default columns can be configured via 2 steps:

- Open your list > Cog menu > click 'Reset to column defaults' button

- Then on the list again > click 3-dot on one of the columns > Configure > List layout

I hope that fixes your issue.