- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2024 09:08 PM
I have a requirement to trigger surveys for specific users on a quarterly basis. It is not related to any records or table trigger conditions; the survey should simply be sent to specific users quarterly. Is this possible
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2024 10:25 PM
Hi @Renjisha ,
Yes, you can do this, follow below steps.
- Create/design your survey.
- Now go to your survey and add user under related list "Survey Users"
- Create one schedule job and run that quarterly.
- Script:
var surveyId = '502a2c44d7211100158ba6859e6103a3'; // replace it with your survey sysid
var returnIds = new SNC.AssessmentCreation().createAssessments(surveyId);
var returnValues = returnIds.split(',');
if (returnValues.length >= 2)
users = parseInt(returnValues[1]);
else
users = 0;
if (users > 0)
gs.log(gs.getMessage('Invited {0} users to take the survey.', users+''));
else
gs.log(gs.getMessage('No new invitation sent for the survey'));
​
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2024 10:25 PM
Hi @Renjisha ,
Yes, you can do this, follow below steps.
- Create/design your survey.
- Now go to your survey and add user under related list "Survey Users"
- Create one schedule job and run that quarterly.
- Script:
var surveyId = '502a2c44d7211100158ba6859e6103a3'; // replace it with your survey sysid
var returnIds = new SNC.AssessmentCreation().createAssessments(surveyId);
var returnValues = returnIds.split(',');
if (returnValues.length >= 2)
users = parseInt(returnValues[1]);
else
users = 0;
if (users > 0)
gs.log(gs.getMessage('Invited {0} users to take the survey.', users+''));
else
gs.log(gs.getMessage('No new invitation sent for the survey'));
​
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------