Serviceportal - Get parameter value from URL

vai
Kilo Contributor

How can i get the URL and verify the value of a parameter value in a ACL script..

i have tried 

   var val = $sp.getParameter("view");  also GlideTransaction.get() 

but both doesn't seem to work...

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

ACL script is server side so you cannot use that.

try this and check once

var viewName = gs.action.getGlideURI().getMap().get('view');

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

Im in a scoped application, when i tried the above line, it gave the below error..

 

Execute operation on API 'ScopedGlideSystem' from scope 'xyz' was denied. The application 'xyz' must declare a cross scope access privilege. Please contact the application author to update their privilege requests.

 

any help on how to resolve this ?

Hi,

I believe it should work in scoped app as well; but since you want to run it in portal that may be causing the issue

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Hi,


Can you elaborate more on what exactly you are trying to achieve with reading the parameter value and its use in ACL script ? 

Maybe there is some other way of implementing the solution instead of fixing the ACL 

Thanks

Ishan Parikh