Checkbox not appearing on notification

Joshua Comeau
Kilo Sage

using a mail script to call a variable which is not appearing:

anything wrong with this script:

JoshuaComeau_0-1703697237305.png

 

 

1 ACCEPTED SOLUTION

@Joshua Comeau : That's correct. As you are printing only the variable value its displays only value.

 

template.print('YOUR VARIABLE QUESTION: ' + current.variables.your_variable_name);

 

Using this statement it prints the question followed by the value of it. If you are looking for all variables to be printed on the notification  refer the below article where I answered similar question.

 

https://www.servicenow.com/community/guided-learning-itsm/reading-variable-name-from-service-catalog...

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

View solution in original post

6 REPLIES 6

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Joshua Comeau ,

Please find the below link

https://www.servicenow.com/community/developer-forum/need-to-show-true-checkbox-on-notification/m-p/...

 

For this you need to glide record and print the variable name ib notification.

Please let me know if this helps.

 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

can you provide script example?

Please find the below script:

var reqitem = new GlideRecord('sc_req_item');
reqitem.addQuery("sys_id", current.request_item);
reqitem.query();
if(reqitem.next()) {
	template.print("Hello3");

	// add here logic to check variable value is true then only print
	
}
If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Sainath N
Mega Sage
Mega Sage

@Joshua Comeau : While printing the variable value, use current.variables.your_field_name in your template statement (in line 8 as per the screenshot) and give a try.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.