Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

Alex Bissmeyer
ServiceNow Employee

If you want to capture feedback after a user has submitted a catalog item or record producer here is one option to leverage Surveys and prompt the user immediately instead of waiting for them to get an email.

 

Here is what the end result looks like.


survey_v2_1.gif

Note: This works for the employee center/service portal

1. Create your Survey

For this example I just picked an OOB survey

 

2. Create a catalog client script

Set the type as onSubmit and the UI Type as Mobile/Service Portal

 

function onSubmit() {
    spModal.open({
        message: 'Let us know if you have any comments on this item',
        title: 'Provide Your Feedback!',
        widget: 'surveys_and_assessments_v2', // widget ID, not sys_id
        widgetInput: {
            type_id: '44f6b8f953673300cfbdddeeff7b1285',
        },
		size: 'lg',
        buttons: [{
            
                label: 'close',
                primary: true
            }
        ]
    }).then(function(confirmed) {
        if (confirmed) {
            //If redirect is needed update the line below
			//location.href = "sp?id=requests";
            return true;
        }
    });

}

 

3. Clone and modify the take_assessment widget and modify the lines highlighted.

AlexBissmeyer_0-1785444386582.png

 

Enhancements to this such as randomization or checking to see if a user has already been asked for a survey could be included but this is just a rough example of what can be done.

Hopefully this helps!

 

Comments
ajmalmuhamm
Tera Contributor

Hey @Alex Bissmeyer ,

Thanks for sharing this! This is a great way to collect user feedback immediately after a catalog item or record producer is submitted, rather than relying solely on email-based survey invitations.

Using spModal to display the survey widget provides a much smoother user experience in Employee Center and Service Portal. I also like that you've mentioned the possibility of extending the solution by randomizing survey prompts or preventing users from being asked multiple times.

One additional suggestion would be to check whether the request was submitted successfully before displaying the survey, so users are only prompted after a successful submission. Overall, this is a clean and practical approach—thanks for sharing!

Version history
Last update:
3 weeks ago
Updated by:
Contributors