I created hidden variables on catalog form and those hidden variables are coming on the approval email. How can i remove those variables on the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:55 AM
I created hidden variables on catalog form and those hidden variables are coming on the approval email. How can i remove those variables on the email.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:00 AM
Hi
It sounds like you are using a UI Policy or Client Script for that. If so you would likely have to add a condition to the attached script to exclude the variable however this solution would not be very maintainable if you had multiple catalog items with multiple variables that are to be hidden during email notifications.
var label = v.getGlideObject().getQuestion.getLabel();
var value = v.getDisplayValue();
if(label != '' && label != 'variable you want to hide' && value != '' && value != 'false'){
template.print(...);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:02 AM
Hi,
you need to check value of that variable
if it's not empty then it means it is populated
can you share your script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 05:47 AM
Hi
Your question is generic and without looking at what you have done till now is difficult to comment or propose solution to.
Generically speaking if you do not want empty variables in your Email then you can refer the solution provided in blog below from Amlan on the above query:
https://community.servicenow.com/community?id=community_blog&sys_id=ee8519acdb00bfc42be0a851ca961921
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke