Get sysparm value from URL in a list control

Goran WitchDoc
ServiceNow Employee
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

Hmmm..


For list v3 and in general a possibly more robust (very low-code/no-code!) solution could be:



-spin up a list layout view for change_request or other list in your scenario


-On the "New" UI action set up a visibility record to exclude that view for visibility.


-then just ensure that view comes up in your use case (e.g. with view rules) !



Andras


find_real_file.png


In that case RP.getParameterValue() will work.



Swati


Sorry, it won't for for me if I trying to control the new button in a list that isn't a related list. For example incident.list or change_request.list


I suppose the Rp.getParameter can be used in the ui action that applies to the list for the particular table.


nope, it doesn't work with it's a "normal list" list incident.list and not a related list..



//göran