Create Survey Button on Incident form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2024 09:18 AM
Need to create Survey button on incident form, so once we click on survey button, Survey checkbox on current incident should be checked and it should redirect to new incident survey created form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2024 10:59 AM
Hi @Community Alums
May i know why you need a survey button on Inc. Survey is something, which trigger, when Incident get closed. It is OOTB and we recommend to use that.
Adding new button will increase the technical debt.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2024 11:26 AM
Hello @Community Alums ,
You can try the below:
Fill out the UI action details as follows:
- Name: Create Survey
- Table: Incident [incident]
- Action name: create_survey
- Client: true
- Onclick: onClickCreateSurvey()
function onClickCreateSurvey() {
// Check the "Survey" checkbox on the current incident
g_form.setValue('u_survey', 'true'); // Replace 'u_survey' with the actual field name of the survey checkbox on the Incident table
// Redirect to the new incident survey form
var redirectURL = '/u_incident_survey.do?sys_id=-1&action=new'; // Replace 'u_incident_survey' with the actual table name of your incident survey table
window.location.href = redirectURL;
//action.redirectURL(redirectURL);
}​
Make sure you set the Isolate Script to False.
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.