I have to set notification subject.

niveditakumari
Mega Sage

Hi, 

 

I have to set notification subject. I have created notification on approval table and have to set notification subject and I have created email script and in that I'm setting order guide field value. I have to set order guide field value in notification subject. 

Please find attached screenshot : 

Notification : 

niveditakumari_0-1770727117548.png 

 

Email Script : 

niveditakumari_1-1770727167837.png

 

Can you please help me to set subject. 

 

Regards, 

Nivedita 

 

 

 

 

 

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@niveditakumari 

you can't call email script from subject of notification. Why you want to include questions in email subject?

not a good idea

call email script from body, don't give anything in subject

Set the subject from email script using email.setSubject()

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar

 

As per story requirement We have to add that in Subject. 

Can we set subject using email.setSubject in email script and call that email script in body to set Order guide field value. 

Can you please help me with email script to achieve that. 

 

Regards, 

Nivedita 

 

 

@niveditakumari 

yes we can set subject from email script using email.setSubject()

you can query in email script and get the variable value

what did you start and where are you stuck?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

yashkamde
Tera Guru

Hello @niveditakumari ,

 

there is one method in email script :

email.setSubject('Your subject');

 

This will set the subject in notification and also this will override the subject from notification..

If my response helped mark as helpful and accept the solution.