Trigger a platform feedback survey for all active users in the sys_user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi Team,
I am working on a requirement to create and trigger a survey on a monthly schedule for all active users in the sys_user table.
So far, I have:
- Created a survey under All > Surveys > View Survey > New
Created one metric category
Added a test question under that category:
Published the survey
Configured a scheduled job trigger to run on a recurring basis
However, the survey is still not being triggered.
Can anyone please confirm whether I am missing some step or what needs to be corrected here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @mshahvej
- Right-click the form header and select Copy sys_id (or double-click the information bar to get it). Note this down.
- Configure your schedule job:
Navigate to System Definition > Scheduled Jobs.
Click New and select Automatically run a script of your choosing.
Fill in the following details:
- Name: Send Monthly sys_user Survey
- Run: Monthly (or choose a specific date/time)
Paste the following script into the Run this script block, being sure to replace 'YOUR_SURVEY_SYS_ID_HERE' with the Sys ID you copied in Step 1:
var surveyId = 'YOUR_SURVEY_SYS_ID_HERE'; // Replace with your Survey Sys ID
var grUser = new GlideRecord('sys_user');
grUser.addActiveQuery();
grUser.query();
while (grUser.next()) {
var assessment = new SNC.AssessmentCreation().createAssessments(surveyId, '', grUser.sys_id);
}
Refer:
https://www.servicenow.com/community/developer-forum/survey-on-the-sys-user-table/td-p/3179848
https://www.youtube.com/watch?v=7hjysB0Wvd4
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti