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
Tera 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 ?

 

 

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 

AndersBGS
Tera Patron

Hi @ammar_k ,

 

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

 

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! 🙏