I have to create a survey where I have to show the RITM number , resolved by and short description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 01:49 AM
Hi Community Experts ,
I need your help in creating a survey.
In the survey I have to show few information on the top as RITM Number , Resolved By and short description when user click on survey link .
Look of the survey would be like
Ticket number: (Prepopulated) Dynamic according to RITM or INC
Short Description: (Prepopulated) Value from same RITM
Resolved by: (Prepopulated) Value from same RITM
How would you rate the service received?
Thumbs up image Thumbs Down Image
In case of thumbs down ,a text has to appear that sorry for not meeting the expectations.
Can anyone please help . nothing is working
I have searched , but no luck , not sure if scripting will work here , if it will then how?
in the data type i can see reference type but not sure if that could help in achieving the requirement , cause it is giving me option to select but how do I restrict to current RITM.
Any help ,idea , advise would be great.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 02:12 AM
Hi @Shivangi Singh2 ,
1.Passing RITM/INC Info to Survey
You need to pass the RITM (or INC) record reference to the survey when the link is sent. That way, the survey can dynamically use it.
🔗 Survey Link Format (example):
https://<instance>.service-now.com/sp?id=survey&sys_id=<SURVEY_ID>&ritm_id=RITM1234567
2.Create a Data Lookup in Survey Record Producer
If you’re using a Record Producer or Scripted Survey, you can:
- Create a Reference field called ritm_id pointing to sc_req_item table.
- In the form (top section), show:
- ritm_id.number → for RITM number
- ritm_id.short_description
- ritm_id.resolved_by.display_name (or name)
3.Using GlideAjax to Fetch RITM Fields Dynamically
If reference isn’t automatically resolving, write a GlideAjax script:
✅ Script Include:
var SurveyRITMHelper = Class.create();
SurveyRITMHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getRITMInfo: function () {
var ritmID = this.getParameter('sysparm_ritm_id');
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(ritmID)) {
return JSON.stringify({
number: ritmGR.getValue('number'),
short_description: ritmGR.getValue('short_description'),
resolved_by: ritmGR.getDisplayValue('resolved_by')
});
}
return '';
}
});
Catalog Client Script (onLoad):
function onLoad() {
var ritm_id = g_form.getParameter('ritm_id'); // passed via URL
if (!ritm_id) return;
var ga = new GlideAjax('SurveyRITMHelper');
ga.addParam('sysparm_name', 'getRITMInfo');
ga.addParam('sysparm_ritm_id', ritm_id);
ga.getXMLAnswer(function(response) {
var data = JSON.parse(response);
g_form.setValue('ritm_number', data.number);
g_form.setValue('short_description', data.short_description);
g_form.setValue('resolved_by', data.resolved_by);
});
}
4.Thumbs Up/Down + Conditional Message
Setup:
Create a multiple choice variable: How would you rate the service?
- Option 1: 👍 (Value = up)
- Option 2: 👎 (Value = down)
- Create a single-line text field (or description field): apology_message
- Set default as blank.
Then add a UI Policy:
- Condition: rate_service is down
- Action: Show apology_message
- Set the value: "Sorry for not meeting your expectations."
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 08:16 AM
Hi @pratikjagtap ,
Thanks for the reply , but i am not using catalog or record producer .
didn't see any option for scripted survey though?
Can you elaborate on that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 02:18 AM
you didn't give any details
what did you configure? where? screenshots etc
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 02:40 AM
I have already provided how the survey will look . I have configured assessment for survey.