Catalog Variables in Email Subject Line

alexcharleswort
Tera Expert

So, to start, I have a notification on the sc_task table set to run whenever a Task is opened assigned to a specific assignment group.

They want a few of the variables that I have set in the catalog item to   be present in the SUBJECT LINE.

How do I get my variables (term_name, term_empid, and term_location) to populate in the subject line of these emails?

6 REPLIES 6

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

You should be able to use ${variables.term_name}, ${variables.term_empid}, etc.



Please mark this post helpful or correct if applicable.


${current.variables.term_name}


${current.variables.term_empid}


${current.variables.term_location}


Garrison Ball
Tera Contributor

Neither of the listed solutions worked in my client's Istanbul instance.  I suspect this is because Variables are associated at the 'Request Item' level, and our notifications are being generated on the 'Service Catalog Task' record.

To access the variable, we must dot-walk to the Request Item.

For a variable named 'req_type', I have verified that this will work in the Subject Line of the SC Task notification:

${request_item.variables.req_type} 

There is no need to call 'current' when working with Email variables as they function somewhat differently than other variables in the system.

Of course, we must be sure that a variable with this name exists on *all* items which could potentially trigger this notification.  Otherwise, we can add conditions so the notification will only fire for specific Catalog Items.

I hope this is helpful to others who stumble across this page in the future.

alexcharleswort
Tera Expert

I didn't have to dot walk up to the item if when I created my task I made sure to select them from the slushbucket. If variables weren't present on the task itself then, yes, I would have had to dot walk up. Can't reference something that isn't there.