Comments on: Populating Default Values with a URL or Module https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 21:30:21 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Aleksandr Stepurin https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6714 Tue, 19 Nov 2013 23:16:44 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6714 Hi to all,

Thanks for this information really useful!

I have a question: is there any way to save incident using URL? I mean to create and save incident in Opened state using URL in one go.

Thanks in advance.

]]>
By: Mark Stanger https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6713 Wed, 29 Aug 2012 20:58:24 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6713 In reply to Jim.

‘sysparm_query’ is only available for standard records and forms. In the service catalog you can accomplish something similar by using client scripts. Here’s an article that describes how to do that.

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

]]>
By: Jim https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6712 Wed, 29 Aug 2012 18:45:23 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6712 Mark,
I am trying to use this as well, but I want to use with an order guide. When a person is hired, I want to send an email to the hiring manager with a link to the new user provisioning screen with the user name populated. My link brings me to the right screen, but the variable, “requested_for” is not populated.
……service-now.com/com.glideapp.servicecatalog_cat_item_guide_view.do?sysparm_initial=true&sysparm_guide=37c517ae0a0a0a6a00c2ee57a47ebddf&sysparm_query=requested_for=odonohus
Should I be using a different syntax for the variable>

]]>
By: will https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6711 Wed, 13 Jun 2012 16:45:16 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6711 In reply to Mark Stanger.

Thanks Mark, got it working late yesterday.

]]>
By: Mark Stanger https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6710 Tue, 12 Jun 2012 16:34:26 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6710 In reply to Will.

You only need one ‘sysparm_query’ parameter in your URL. You also need to use the ‘sys_id’ if you’re using URL arguments. Something like this should work…
incident.do?sys_id=-1&sysparm_query=active=true&sysparm_stack=incident_list.do?sysparm_query=active=true^cmdb_ci=YOURCISYSIDHERE

Having said that, if you’re doing this from a ‘Create new record’ module, then you shouldn’t need to add ‘sysparm_query’ parameters or arguments at all. You can just use the filter on the module definition to supply the values you want to set in the new record.

]]>
By: Will https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6709 Tue, 12 Jun 2012 16:29:22 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6709 I’m trying to use this in order to populate a specific CI into the incident or request, but haven’t been able to get it to work. Do I need to use the sysID or the text? here is the link in the ‘Create New’ incident module: incident.do?sys_id=-1&sysparm_query=active=true&sysparm_stack=incident_list.do?sysparm_query=active=true

I tried adding an &sysparm_query=cmdb_ci=sysid

Where sysid is I put the sys id, but it didn’t work. Any suggestions?

]]>
By: Scott Hetzel https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6708 Tue, 03 Jan 2012 22:52:03 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6708 In reply to Scott Hetzel.

Correction from my post regarding interceptor above: better to use; ‘change_request.do?sysparm_query=type=Normal^state=1’ or similar. My sysparm_stack is wrong and not needed for my use case.

Regards,
Scott

]]>
By: Scott Hetzel https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6707 Sat, 31 Dec 2011 17:53:14 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6707 Good info..

I used this trick to set a Change “type” with an interceptor instead of defining a view with an interceptor. The target URL I used:

change_request.do?sysparm_stack=change.do&sys_id=-1&sysparm_query=type=Expedited

]]>
By: Mark Stanger https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6706 Fri, 30 Apr 2010 15:16:14 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6706 In reply to Brian Broadhurst.

Hey Brian,

My experience has been that the ‘OR’ gets evaluated before the ‘AND’. That being the case, your query should return exactly what you think it should if you remove the parentheses.

]]>
By: Brian Broadhurst https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/#comment-6705 Fri, 30 Apr 2010 13:44:39 +0000 https://servicenowguru.wpengine.com/?p=1212#comment-6705 Hi Mark,

I wonder if you could give a little more detail about the syntax of the sysparm_query clause in a URL. I’ve recently been trying to use a reference qualifier to do a query that consists of a number of ANDs and ORs for which I would like to be able to use parentheses – but the URL syntax doesn’t seem to allow that. As an example, suppose I want to restrict the list of CIs that are presented when you click the magnifying glass on an Incident form to those where either the Company is as entered on the Incident or the Location is as entered on the Incident, but the Install Status must also be In Service. The kind of sysparm_query I want to generate is:

install_status=1^(company=XYZ Inc^ORlocation=London)

The query doesn’t work with the parentheses there, but without them, how is the query evaluated – is there a precedence such that OR gets evaluated before AND or vice versa? Or are the operators evaluated in sequence from left to right, in which case my query above (minus the parentheses) would return all the CIs that belong to XYZ Inc that are also In Service plus all the CIs that are in London regardless of their Install Status.

Brian

]]>