- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 03:45 AM
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;
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 04:35 AM
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.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 04:35 AM
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.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 04:42 AM
Thanks. This means that I can get whatever parameters in the page URL viewing the widget in Service Portal.