How to populate Request For name in Email notification

shaik_irfan
Tera Guru

Hello Everyone,

i want to populate Requested By name under Email template, Requested For (u_req_for) is from RITM table which should be populated on Template i tried Select Variables which is present in the Template but i unable to find the Requested For name since the email template is written on Approval table.

Can anyone please help me out how to populate the RITM table field on Approval table ?

1 ACCEPTED SOLUTION

Rajesh feedbacks were helpful but you will still need to query the req_item table;



Please try this just for the fun somewhere on your code



<mail_script>


var ritm = new GlideRecord('sc_req_item');


if(ritm.get(current.sysapproval)){


var req_for = ritm.u_req_for.name;


template.print("Requested for :"+ritm.request.requested_for.name);


template.print("Requested by :"+ritm.u_req_for.name);


}


</mail_script>


View solution in original post

27 REPLIES 27

Younes,



My request for field is on RITM (sc_req_item) table which is user created field and the label name is "u_req_for", i tried below Requested for: ${u_req_for} but it is not working, when i preview the notificaiton it is displaying just like below:





Requested for:


Rajesh,



Can you please let me know where to write below html message ?



Is it under Template ?


there is section in notification : What it will contain Put this line in HTML Message like below



Request Requested for: ${request.requested_for}




Email notification what v2.png




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Rajesh,



Just wanted to confirm as my Requested For label name is u_req_for so do i need to mention as : ${request.u_req_for} ?


Hi Shaik,



I don't think you will be able to use ${request.u_req_for} if you are not creating a email notification template on sc_request table.