The CreatorCon Call for Content is officially open! Get started here.

How do I create survey instances from a scheduled job?

angiejones
Tera Contributor

My customer wants to send out surveys two weeks after the state is closed complete. I have a field whose value is 14 days from the closed complete date so I can query all the records daily to see if there are any matching records with today's date. I just am not sure how to trigger the creation of survey instances and send out the invites from a scheduled job. Any help is appreciated. Thanks!

1 ACCEPTED SOLUTION

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Angie,



I can think of 3 options.



1. Create a Trigger condition based on a field (ex: boolean)   which would would set by a scheduled job after 14 days.


2. Crate instances using new SNC.AssessmentCreation().createAssessments() in the Scheduled Job


3. Make the Survey as Public and send the Survey URL from the Scheduled Job.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


View solution in original post

10 REPLIES 10

Dan Johnson
Tera Contributor

Would you be able to provide a code snippet of what worked for you? Specifically what you put in the scheduled job. Thanks!