Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

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!

 

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