How to restrict the submission of same survey if its already submitted by the user using the link send to them in email once incident is closed

bhavna6
Tera Contributor

How to restrict the submission of same survey if its already submitted by the user using the link send to them in email once incident is closed.

The survey is created using survey wizard.

20 REPLIES 20

Can you provide a sample script?


  var gr = new GlideRecord("u_sys_eng_questionaire");


  gr.addEncodedQuery("sys_created_onRELATIVEGT@dayofweek@ago@30^sys_created_by="+ String(current.caller_id));


  gr.query();


  if(gr.next()){


  // User has filled out a survey in the last 30 days


  action.setRedirectURL(current);


  }


This was setup on a ui action from an incident form.


It calls the survey table and checks if the current user has filled out a survey in the past 30 days.


If it finds an entry it returns to the incident but you can redirect to where ever you like or open a message dialog.


We had an email sent to the user from this if there was no record found. So they only got the email if they hadn't already done the survey.


What are your triggers for the survey? Is it possible to have this check on the save ui action if the survey is related to a specific record type i.e: CHG, PRB, INC etc...


We are sending the survey to the user once the incident is closed.


So user will be receiving an email with the link for survey.


Once he clicks on the link he can take up the survey.


The issue we are facing is that if the user clicks on the same survey link from email   he can take up the survey again.


So we need to restrict this retake of survey if he has already taken one.