How to pass variables via URL into pages

usalash
Kilo Explorer

Hi,

I'm creating a separate knowledge base in our Service-Now instance in order to better suit our needs.

I'd like to be able to display a list of knowledge articles, and when the user clicks on an article, have it pass that article's ID to a new page in our 'site' which will display the article and any related case studies.
To display the article, I am using a Dynamic Content block inserted into a page. I want to be able to pass in a variable through the URL in order to choose which article to display.

This is how the KB View page normally does it.
kb_view.do?sys_kb_id=[id] where the id in brackets is the id of the article.

I've copied the code from the kb_view UI Page into the Dynamic Content block that I created and made sure 2-phase was checked. I want to know, how should I pass in the ID of an article to make it view in a Dynamic Content block embedded into a page?

Thanks in advance for your help.

2 REPLIES 2

JonathanJacob
Mega Sage

check out the RP object:

RP.getParameterValue(parameterName) - returns the value of the specified parameter passed on the URL
RP.getParameters() - returns the parameters passed on the URL

http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#RP


Thank you for the reply. I found that this works for me more consistently than the sysparm variable.