Glide SP Scriptable - What is a parameter and what are the parameters that I can set in $sp.getParameter?

hanaphouse
Giga Guru

I am pretty new to the Glide SP Scriptable area and want to know more in-depth details about the method .getParameter() of Glide SP Scriptable.

  • How do I know that it is a valid parameter like in this case "catalog_id"?
  • Is there a master list of parameters because aside from "catalog_id", I have no idea what are the other parameters available?
var catalog_id = $sp.getParameter("catalog_id") ? $sp.getParameter("catalog_id") + "" : "-1";
var catalogSelectorArr = [{value: "-1", displayValue: gs.getMessage("All")}];
data.selectedCatalogIndex = catalog_id == -1 ? 0 : -1;
1 ACCEPTED SOLUTION

RaghavSh
Kilo Patron

For $sp.getParameter() you need to check the URL of the page to get valid parameter.

For example: /id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9 if you take this URL and use $sp.getParameter() you will get different results based on parameters you pass:

 

$sp.getParameter('id') this will return sc_cat_item

$sp.getParameter('sys_id') this will return 3f1dd0320a0a0b99000a53f7604a2ef9

 

You can clone any OOB widget  on portal in the server side script you can try to pass different parameters present in URL for testing purpose.

 

find_real_file.png

 


Raghav
MVP 2023

View solution in original post

2 REPLIES 2

RaghavSh
Kilo Patron

For $sp.getParameter() you need to check the URL of the page to get valid parameter.

For example: /id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9 if you take this URL and use $sp.getParameter() you will get different results based on parameters you pass:

 

$sp.getParameter('id') this will return sc_cat_item

$sp.getParameter('sys_id') this will return 3f1dd0320a0a0b99000a53f7604a2ef9

 

You can clone any OOB widget  on portal in the server side script you can try to pass different parameters present in URL for testing purpose.

 

find_real_file.png

 


Raghav
MVP 2023

Thanks. This means that I can get whatever parameters in the page URL viewing the widget in Service Portal.