Comments on: Parse URL Parameters in a Client Script https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/ ServiceNow Consulting Scripting Administration Development Wed, 06 Mar 2024 22:38:53 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Terryio https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7655 Thu, 12 Apr 2018 15:44:22 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7655 Thanks, it works perfectly in service portal.

]]>
By: Jim Pisello https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7654 Thu, 26 Oct 2017 19:22:22 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7654 In reply to Lisa Silvaroli.

Hi Lisa,

The sysparm_user parameter stores the sys_id for the current user’s User record. If you wanted to get other information from that user record you would need to write a script. Assuming you’re doing this in a client script, I’d suggest either using an asynchronous GlideAjax call to a script include (preferred method and required if you’re working in a scoped app), or using a client-side GlideRecord query with a callback function.

GlideAjax API: https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=c_GlideAjaxAPI
Client GlideRecord: https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=c_GlideRecordClientSideV3API

]]>
By: manita https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7653 Wed, 18 Oct 2017 13:58:38 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7653 In reply to Lisa Silvaroli.

Hi Mark,

I am having a similar issue as Lisa.

I created a URL and trying to fetch a String Value and pass it to from Orderguide 1 to another Orderguide 2, but with below URL, the sys_id is getitng populated but i need the display value of the sysparm_personal that user populates in Orderguide 1.

I hardcoded the sys id in sysparm_personal, but need an approach to get the display value of this string variable.

https://test.service-now.com/nav_to.do?uri=%2Fcom.glideapp.servicecatalog_cat_item_guide_view.do%3Fv%3D1%26sysparm_initial%3Dtrue%26sysparm_guide%3D3b257f364facee0056384bff9310c747%26sysparm_personal%3D6066430bdb45c3406aff591e5e9619e1

]]>
By: Lisa Silvaroli https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7652 Mon, 17 Jul 2017 14:01:57 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7652 I am using:
javascript:
var answer = RP.getParameterValue(“sysparm_user”); answer;

It is passing the user but displaying the sysID – is there a way to get it to display the display name?

]]>
By: Jim Pisello https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7651 Fri, 14 Jul 2017 16:18:56 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7651 In reply to Lisa Silvaroli.

Hi Lisa,

The URL can be found in your web browser’s address bar.

]]>
By: Lisa Silvaroli https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7650 Tue, 16 May 2017 12:22:03 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7650 Please excuse me as this topic is very new to me but I am trying to achieve the same results. I’m not understanding where to find the URL… any more direction you can give would be greatly appreciated!

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7649 Wed, 01 Mar 2017 13:51:17 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7649 In reply to Tom.

Thanks Tom. Unfortunately, ServiceNow’s Service Portal and Mobile apps don’t support any of this type of custom scripting very well. I’ve posted a potential workaround at the bottom of the article. It should work in Service Portal but I’m not sure about the mobile app. Please give it a try and see.

]]>
By: Tom https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7648 Wed, 01 Mar 2017 09:14:49 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7648 Hi Mark,

Thank you for this great tutorial. I am trying to get this working on the mobile application, but the getParmVal method does not work on the native app. Do you have a workaround for this?

Thanks in advance,

Tom

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7647 Thu, 25 Aug 2016 11:26:11 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7647 In reply to Cassidy.

It should work from anywhere, as shown in the final catalog client script. In some cases, you need to introduce a bit of a delay to the client script using ‘setTimeout’ to make sure the page is loaded before your client script attempts to run. You can google ‘javascript settimeout’ for some examples of how to use that.

]]>
By: Cassidy https://servicenowguru.com/client-scripts-scripting/parse-url-parameters-client-script/#comment-7646 Thu, 25 Aug 2016 07:02:25 +0000 https://servicenowguru.wpengine.com/?p=2186#comment-7646 Hi Mark.

Great tutorial and the code works great, i run into a few problems though, which I hope you can help me with.
I can only execute this code from the Google Chorme Dev console, and only if i choose the iFrame as the context. Is there any way to execute this, coming from another page?

]]>