Workflow Notification Activity vs Notification

MStritt
Tera Guru

On a regular Notification, I get a 'Users/Groups in fields' pick list where I can select a field off the RMR.

find_real_file.png

On the Notification Activity on the Workflow, I don't see/get it. Is this something I can add? I'm not able to navigate to a specific field (value) on the RMR where I want the email to be sent to. 

find_real_file.png

1 ACCEPTED SOLUTION

You can use answer = current.u_st_email;

 

But yes, as suggested by Mark, it is not recommended to use Workflow notification. You can use the Create Event activity instead and create an event Registry record and map the registry record to a notification. 


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

View solution in original post

14 REPLIES 14

Can you confirm, it is a reference field and referencing the sys_user table. And try with this.

Try with below code.

if (current.u_st_email) {
    answer = current.getValue('u_st_email');
}

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

Actually, it's a string field. I'll try your update.

Hi Sanjiv,

Added the following script, but it didn't send the notification.

// Set the variable 'answer' to a comma-separated list of user or group sys_ids that you want the email sent to.

if (current.u_st_email) {
    answer = current.getValue('u_st_email');
}

find_real_file.png

Does this user have an user account in Servicenow? Also can you confirm u_st_email is a field on the table where you are running this workflow on?

Can you try

 

var u = new GlideRecord('sys_user');

u.addQuery('email',current.u_st_email);

u.query();

if (u.next())

{

answer = u.sys_id;

}

 


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

The email address may or may not be associated with a contact in ServiceNow. It's a string field. It's on the table the workflow is being created against.

find_real_file.png

find_real_file.png