- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
I have a requirement where an external system redirects users to ServiceNow for ticket creation.
Requirement:
- User clicks a link from an external system
- ServiceNow form opens
- Some fields should be automatically populated based on URL query parameters
Example:
Details:
- Query parameters contain multiple field values
- Some parameters are repeated (same key with multiple values)
- These values need to be mapped to ServiceNow form fields such as:
- Text fields
- Dropdown fields
- Multi-value fields (checkbox/list collector)
Questions:
What is the best approach for this use case:
- Record Producer
- Catalog Item
- or any other method?
How can we capture URL query parameters in ServiceNow and populate fields on form load?
How to handle multiple values for the same parameter (e.g., FIELD=value1 & FIELD=value2)?
What is the recommended implementation approach:
- Client Script (onLoad)
- UI Script
- or any out-of-box feature?
Expected Outcome:
When user opens the ServiceNow form via URL, fields should be pre-populated automatically so the user can review and submit the form.
Any guidance or best practices would be really helpful.
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Approach
1) you can take them to record producer link in portal
2) then use onLoad catalog client script to grab the values from URL parameters and then set in record producer variables
3) then map those record producer variables to target fields of ticket table
some links for help
Extracting URL Parameters in ServiceNow Using Client Scripts
3 Ways to Populate Values in ServiceNow via the URL
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @RushikeshB24337 ,
You can use Record Producer + On Load Client Script :
Script :
function onLoad() {
var field1 = g_form.getParameter('FIELD1');
if (field1) {
g_form.setValue('field1_variable', field1);
}
if (field2) {
g_form.setValue('field2_variable', field2);
}
}
Then Use this script in record producer form for mapping the fields :
(function producerScript(current, producer) {
current.short_description = producer.field1_variable;
current.category = producer.field2_variable;
})(current, producer);
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @RushikeshB24337 ,
For this requirement , we did a scripted Rest API and passed the parameter via url to populate the value in other end (that was a mobile app, by their scripting, they did populate the fields at their end).
You can refer these links:
3 Ways to Populate Values in ServiceNow via the URL
https://servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/
https://www.youtube.com/watch?v=QHMQEis8nno
KB0778369 URL paramters do not get populated to the incident form
https://www.servicenow.com/community/developer-forum/scripted-rest-api-dynamic-url/m-p/3391575
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
Hello @Tanushree Maiti @yashkamde @Ankur Bawiskar @Yaramala Thanks for helping