How to trigger reminder email on 3rd day if user not filled survey yet

VIKAS MISHRA
Tera Contributor

I want to send the reminder email to the user if user has not filled the survey till 3rd day of incident resolution. 

I have already created the reminder notification and event but not sure in phow to write schdule job on it as not sure in which table does survey response gets saved so unable to glide that table.

Please tell me the table name and help me with the script 

1 ACCEPTED SOLUTION

SANDEEP28
Mega Sage

@VIKAS MISHRA  Survey records are present in Assessment Instance table. So you have to create event & notification on Assessment Instance table first then create a schedule job.

 

Follow below steps which are present in https://www.servicenow.com/community/now-platform-forum/how-to-send-the-reminder-notification-survey... 

 

Steps below

  1. Create a new Event (Event > Registry) on Assessment Instance table
  2. Create a new Email > Notification for the assessment instance table) and associate the above event
  3. Ensure your notification has

    • Send to event Creator true
    • Event parm1 contains recipient as true
  4. Create schedule job which runs daily and checks the records and sends notification to the user

Script:

 

 

sendNotification();

function sendNotification(){

try{
var grSurvey = new GlideRecord('asmt_assessment_instance');
grSurvey.addEncodedQuery('stateINready,wip^userISNOTEMPTY');
grSurvey.query();
while (grSurvey.next()) {
	grSurvey.eventQueue('event_name', grSurvey, grSurvey.user, '');
}
}
catch(ex){
gs.info(ex);
}

}

 

 

SANDEEP28_0-1690743116259.png

 

SANDEEP28_1-1690743116216.png

 

 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !! 

 

View solution in original post

3 REPLIES 3

The url provided by you is saying "The item you are trying to access is not available."

So not getting any answer there

SANDEEP28
Mega Sage

@VIKAS MISHRA  Survey records are present in Assessment Instance table. So you have to create event & notification on Assessment Instance table first then create a schedule job.

 

Follow below steps which are present in https://www.servicenow.com/community/now-platform-forum/how-to-send-the-reminder-notification-survey... 

 

Steps below

  1. Create a new Event (Event > Registry) on Assessment Instance table
  2. Create a new Email > Notification for the assessment instance table) and associate the above event
  3. Ensure your notification has

    • Send to event Creator true
    • Event parm1 contains recipient as true
  4. Create schedule job which runs daily and checks the records and sends notification to the user

Script:

 

 

sendNotification();

function sendNotification(){

try{
var grSurvey = new GlideRecord('asmt_assessment_instance');
grSurvey.addEncodedQuery('stateINready,wip^userISNOTEMPTY');
grSurvey.query();
while (grSurvey.next()) {
	grSurvey.eventQueue('event_name', grSurvey, grSurvey.user, '');
}
}
catch(ex){
gs.info(ex);
}

}

 

 

SANDEEP28_0-1690743116259.png

 

SANDEEP28_1-1690743116216.png

 

 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!