survey

Basina Akash
Tera Contributor

i have created a survey form, and i created a UI page to the survey form , and the UI page is added to the catalog item and an SC TASK is created to the RITM , in the SC TASK form the survey link is displayed , once the user responded the survey form it should not opened again

9 REPLIES 9

Rajdeep Ganguly
Mega Guru


To achieve this, you can follow the steps below:

1. Create a new field in the SC Task table to store the status of the survey (e.g., "Survey Completed").
2. In the UI page, add a script to check the status of the "Survey Completed" field before displaying the survey link.
3. If the "Survey Completed" field is true, do not display the survey link. If it's false, display the survey link.
4. Once the user submits the survey, update the "Survey Completed" field to true.

Here is a sample script for the UI page:

javascript

 

And here is a sample script to update the "Survey Completed" field after the survey is submitted:

javascript
var gr = new GlideRecord('sc_task');
gr.addQuery('sys_id', current.task);
gr.query();
if (gr.next()) {
gr.u_survey_completed = true;
gr.update();
}


Please note that you need to replace 'u_survey_completed' and 'u_survey_link' with your actual field names. Also, replace 'sc_task' with the actual table name if it's different.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER

can you give me UI page script for form 

Unfortunately, he can't. This is a AI generated answer, which is helping by just touching on your question, without even validating the feasibility.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Then how can i get the solution

@Basina Akash 

 

Have you read the solution provided by me ? AI powered answers will not help as suggested by @Mark Manders 


Please mark this response as correct and helpful if it assisted you with your question.