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.

Get sysparm value from URL in a list control

Goran WitchDoc
ServiceNow Employee

I have a list control for that I want to customize so if a specific sysparm(sysparm_nonew) appears in the url, I want to hide the new button.

But I can't find how get get the sysparm_nonew from the url. I tried "gs.action.getGlideURI().getMap().get('sysparm_nonew')" but will only return null no matter if I got sysparm_nonew=true eller not in the URL.

Any ideas?

//Göran

23 REPLIES 23

nthumma
Giga Guru

Thanks,


But that only for related lists


Max C1
Giga Contributor

@Göran Lundqvist Did you ever solve this? I'm trying to do something similar, hide new button based on the current filter ( 'sysparm_query') value. I'm getting the same RP error as well. 

Siddharth23
Tera Contributor

I found the easiest way to do this by referencing to all comments on this post.
Scenario: I want the New Button to be visible every list except where sysparm_element = u_venue_name where u_venue_name is the backend value of my field which is a reference field to cmn_location_table
1. Identify the parameter from the reference list URL :
For ex: sysparm_element = u_venue_name in my case

Siddharth23_1-1692351798978.png

2. Configure the list control for the same by clicking on column

3.  The Omit new button and Omit new condition work in a cohesive manner:

Siddharth23_2-1692351915000.png

RP is OOTB utility. 

Please mark this helpful if this resolves your issue.