Notification trigger in approval table and body passing dynamic but customer need catalog descripti

Gillerla Rajesh
Tera Contributor

Notification trigger in approval table and body passing dynamic,  but customer need catalog varaible description 

 

How can I acces catalog varaible description in notification.

1 ACCEPTED SOLUTION

\Hi,
Your query is wrong in GlideRecord.

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

7 REPLIES 7

\Hi,
Your query is wrong in GlideRecord.

 


Thanks and Regards,

Saurabh Gupta

Can u provide me the query ,

 

Like ur saying add Query right,  I tried different way but not possible can pls u provide me exact one which I need to keep

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Below is the sample mail script for the notification of RITM.

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
										   /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
										   /* Optional GlideRecord */ event) {

	var vs = new GlobalServiceCatalogUtil().getVariablesForTask(current, true);		//current should always be glide record of sc_req_item table or the table on which the variables are attached like in case of record producer it may be incident
	for (var i=0; i < vs.length; i++) 
	{
		var isMRVS=lbl=vs[i].multi_row+"";
		var lbl=vs[i].label+"";
		var dis=vs[i].display_value+"";
		var visible=vs[i].visible_summary+"";
		if(isMRVS=='true')
		{
			var vArr=vs[i];
			template.print("<div>"  + "<strong>" + lbl + "</strong></div><hr>");
			for (var j=0; j < vArr.table_variable.length; j++) 
			{
				template.print("<div><strong>Row: </strong>" + (j+1)  + "</div>"); 
				var tblArr=vArr.table_variable[j];
				for (var k=0; k < tblArr.length; k++) 
				{
					var mrvslbl=tblArr[k].label+"";
					var mrvsdis=tblArr[k].display_value+"";
					if(mrvslbl != '' && mrvsdis!='' && mrvsdis!='false') 
					{
						template.print("<div>"  + "<strong>" + mrvslbl + "</strong>" + ": " + mrvsdis + "</div>"); 
					}
				}
				template.print("<hr>");
			}
		}
		else
		{
			if (lbl != '' && dis!='' && dis!='false' && visible=='true') {
				template.print("<div>"  + "<strong>" + lbl + "</strong>" + ": " + dis + "</div>"); 
			}
		}

	}
})(current, template, email, email_action, event);

Thanks and Regards,

Saurabh Gupta