How to send a survey notification using UI action in Project Table

Sowmya20
Tera Contributor

Hi,

 

I have requirement once project is closed, we want to trigger survey to the account manager and customer contact. 

When Project Manager clicked on UI Action they should have access to add receiver address manually.

 

Thank you

 

 

3 REPLIES 3

Debasis Pati
Tera Guru

Hello @Sowmya20 ,

To achieve this you need multiple things 
one ui page script ,one ui action,script include and one notification and one event as well.


Note:To achieve this in ServiceNow, you'll need to create a UI Action that triggers a pop-up dialog where the Project Manager can enter the email address. Once the email address is provided and "OK" is clicked, the email will be sent. Here’s a way to do that using GlideDialogWindow for the pop-up:

Create the UI Action:
function sendSurvey() {
var dialog = new GlideDialogWindow('email_dialog');
dialog.setTitle('Enter Email Address');
dialog.render();
}

Create a new UI Page named email_dialog:

<g:ui_page>
<g:script>
function submitEmail() {
var email = g_form.getValue('email_input');
var ga = new GlideAjax('SendSurveyEmail');
ga.addParam('sys_id', g_form.getParameter('sys_id'));
ga.addParam('email', email);
ga.getXMLAnswer(function(response) {
alert(response.responseText);
GlideDialogWindow.get().destroy();
});
}
</g:script>

<g:form>
<g:description>
<label for="email_input">Email:</label>
<input type="text" id="email_input" name="email_input"/>
<button type="button" onclick="submitEmail()">OK</button>
</g:description>
</g:form>
</g:ui_page>
Create a Script Include:
var SendSurveyEmail = Class.create();
SendSurveyEmail.prototype = Object.extendsObject(AbstractAjaxProcessor, {
send: function() {
gs.eventQueue('your_event_name')
}
});

Notification:
create your notification or amend the survey in such a way that it will trigger when event is triggered.

Please Mark it as correct if this resolves your issue.

Regards,
Debasis









Ankur Bawiskar
Tera Patron
Tera Patron

@Sowmya20 

you can trigger a survey via UI action using server side code, but since you said you want to send it to particular user and user will select it then take this approach

1) create a UI page and have a reference field to sys_user

GlideDialogWindow: Advanced Popups Using UI Pages 

2) call this UI page from UI action

3) then within UI page processing script use this script to trigger the survey to that user

"Create User Survey" UI Action -> response from johnny27

I hope the information I shared should help you get started and you can enhance it based on your requirement and based on your developer skills

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Sowmya20 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader