Get values from url

Rj27
Mega Guru

Hi All,

Can we get certain values in script include from the url that is generated in lookup.
For eg: If the url coming on clicking the lookup:
https://dev87573.service-now.com/sys_user_list.do?sysparm_target=sc_req_item.request.requested_for&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=requested_for&sysparm_reference=sys_user&sysparm_view=sys_ref_list&sysparm_additional_qual=&sysparm_client_record=session

If I want the value of sysparm_target. Can we get it in script include or any BR? 

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi

You need to access the URL in your client script and then pass it to the SI. Here is a link that can help you.

https://www.servicenowguru.com/scripting/client-scripts-scripting/parse-url-parameters-client-script...

Kindly mark the comment as a correct answer and also helpful if this helps.

View solution in original post

15 REPLIES 15

Hi, 

If this has answered your question, kindly mark the comment as a correct answer so that the question is moved to the solved list.

Ankur Bawiskar
Tera Patron
Tera Patron

@Rj27 

I believe the answer you marked as correct is not as per your question asked.

As per your question you required value of url parameter in the script include or BR

But the answer you marked as correct talks about getting it in client script.

Please mark appropriate response as correct and helpful so that it would benefit future readers.

Regards
Ankur

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

Hi,

I think the requirement is to read the URL of the popup which you cannot access from SI. hence i have suggested to first read it in client script and then pass those values to BR.

@Rj27 kindly confirm how you have achieved the requirement.

Hi Ankur n Asif,

I took the value from client side and passed it to server side. This worked for me hence marked the answer accordingly. 

Thanks for the update.

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