Trigger Survey with flow designer

ammar_k
Tera Expert

Hello, 
I was trying to trigger a survey using flow designer , but the survey is being sent without questions
does anybody know why ? 
thank you for your help 

8 REPLIES 8

Tanushree Maiti
Kilo Patron

Hi @ammar_k 

 

You have OOB assessment/Survey  trigger conditions  feature.

Configure a trigger condition for a survey 

 

Why do you want to use Flow ?

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

GlideFather
Tera Patron

Hi @ammar_k,

 

check your survey/assessment whether it has correctly associated categories and questions.

 

Navigate to [asmt_metric_type] table https://yourinstance.service-now.com/asmt_metric_type_list.do

 

GlideFather_0-1776715618221.png

 

Eventually to the asmt_metric_category with the categories (domains) if your survey has some:

https://yourinstance.service-now.com/asmt_metric_category.do

 

Ynd the questions [asmt_metric] at https://yourinstance.service-now.com/asmt_metric_list.do

 

My only available assessment contains data that I don't want to share here, but feel free to DM me (envelop in the top-right corner) if you want to discuss this further 

_____
Answers generated by GlideFather. Check for accuracy.

AndersBGS
Tera Patron

Hi @ammar_k ,

 

why utilizing flow designer for triggering the survey instead of utilizing the OOTB trigger condition?

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Ankur Bawiskar
Tera Patron

@ammar_k 

that's not going to work. simply inserting record into assessment instance won't help.

You can use custom flow action and trigger assessment using script

check this location where I shared solution for something similar

Survey Trigger on Date Question

AssessmentCreation - Global -> Docs link

Sample below

runSurvey();

function runSurvey() {
    try {
        var gr = new GlideRecord('task'); // Replace 'task' with your table name
        // Find records due in the next 5 days, including today.
        gr.addEncodedQuery('due_date>=' + gs.daysAgoStart(-5) + '^due_date<=' + gs.daysAgoEnd(0));
        gr.query();
        while (gr.next()) {
            //For creating survey instances directly from a scheduled job
            new SNC.AssessmentCreation().createAssessments('Survey Definition SysId', gr.getUniqueValue(), gr.assigned_to.toString());
        }
    } catch (ex) {
        gs.info(ex);
    }
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader